Skip to content

Commit

Permalink
Day 33 - Code Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
fdeniz07 committed Oct 31, 2021
1 parent 9b70813 commit 56634ca
Show file tree
Hide file tree
Showing 25 changed files with 55 additions and 28 deletions.
7 changes: 7 additions & 0 deletions CoreLayer/Entities/Abstract/IDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace CoreLayer.Entities.Abstract
{
public interface IDto
{

}
}
2 changes: 1 addition & 1 deletion EntityLayer/Dtos/BlogAddDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace EntityLayer.Dtos
{
public class BlogAddDto
public class BlogAddDto : IDto
{
[DisplayName("Başlık")]
[Required(ErrorMessage = "{0} alanı boş geçilmemelidir")]
Expand Down
2 changes: 1 addition & 1 deletion EntityLayer/Dtos/BlogDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace EntityLayer.Dtos
{
public class BlogDto:DtoGetBase
public class BlogDto:DtoGetBase,IDto
{
public Blog Blog { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion EntityLayer/Dtos/BlogListDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace EntityLayer.Dtos
{
public class BlogListDto : DtoGetBase
public class BlogListDto : DtoGetBase,IDto
{
public IList<Blog> Blogs { get; set; }

Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/BlogUpdateDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class BlogUpdateDto
public class BlogUpdateDto : IDto
{
[Required]
public int Id { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/CategoryAddDto.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class CategoryAddDto
public class CategoryAddDto : IDto
{
[DisplayName("Kategori Adı")]
[Required(ErrorMessage = "{0} boş geçilmemelidir.")]
Expand Down
2 changes: 1 addition & 1 deletion EntityLayer/Dtos/CategoryDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace EntityLayer.Dtos
{
public class CategoryDto:DtoGetBase
public class CategoryDto:DtoGetBase,IDto
{
public Category Category { get; set; }
}
Expand Down
2 changes: 1 addition & 1 deletion EntityLayer/Dtos/CategoryListDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace EntityLayer.Dtos
{
public class CategoryListDto:DtoGetBase
public class CategoryListDto:DtoGetBase,IDto
{
public IList<Category> Categories { get; set; }
}
Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/CategoryUpdateDto.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class CategoryUpdateDto
public class CategoryUpdateDto : IDto
{
[Required]
public int Id { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/CommentAddDto.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class CommentAddDto
public class CommentAddDto : IDto
{
[DisplayName("Yorum")]
[Required(ErrorMessage = "{0} boş geçilmemelidir.")]
Expand Down
5 changes: 3 additions & 2 deletions EntityLayer/Dtos/CommentDto.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using EntityLayer.Concrete;
using CoreLayer.Entities.Abstract;
using EntityLayer.Concrete;

namespace EntityLayer.Dtos
{
public class CommentDto
public class CommentDto : IDto
{
public Comment Comment { get; set; }
}
Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/CommentListDto.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.Collections.Generic;
using CoreLayer.Entities.Abstract;
using EntityLayer.Concrete;

namespace EntityLayer.Dtos
{
public class CommentListDto
public class CommentListDto : IDto
{
public IList<Comment> Comments { get; set; }
}
Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/CommentUpdateDto.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class CommentUpdateDto
public class CommentUpdateDto : IDto
{
[Required(ErrorMessage = "{0} boş geçilmemelidir.")]
public int Id { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/EmailSendDto.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Net.Http;
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class EmailSendDto
public class EmailSendDto : IDto
{
[DisplayName("İsminiz")]
[Required(ErrorMessage = "{0} alanı zorunludur.")]
Expand Down
6 changes: 4 additions & 2 deletions EntityLayer/Dtos/ImageDeletedDto.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace EntityLayer.Dtos
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class ImageDeletedDto
public class ImageDeletedDto : IDto
{
public string FullName { get; set; }
public string Extension { get; set; }
Expand Down
6 changes: 4 additions & 2 deletions EntityLayer/Dtos/ImageUploadedDto.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace EntityLayer.Dtos
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class ImageUploadedDto
public class ImageUploadedDto : IDto
{
public string FullName { get; set; }
public string OldName { get; set; }
Expand Down
6 changes: 4 additions & 2 deletions EntityLayer/Dtos/RoleAssignDto.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace EntityLayer.Dtos
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class RoleAssignDto
public class RoleAssignDto : IDto
{
public int RoleId { get; set; }

Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/RoleListDto.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using EntityLayer.Concrete;
using System.Collections.Generic;
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class RoleListDto
public class RoleListDto : IDto
{
public IList<Role> Roles { get; set; }
}
Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/UserAddDto.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CoreLayer.Entities.Abstract;
using Microsoft.AspNetCore.Http;

namespace EntityLayer.Dtos
{
public class UserAddDto
public class UserAddDto : IDto
{
[DisplayName("Kullanıcı Adı")]
[Required(ErrorMessage = "{0} boş geçilmemelidir.")]
Expand Down
2 changes: 1 addition & 1 deletion EntityLayer/Dtos/UserDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace EntityLayer.Dtos
{
public class UserDto:DtoGetBase
public class UserDto : DtoGetBase, IDto
{
public User User { get; set; }
}
Expand Down
2 changes: 1 addition & 1 deletion EntityLayer/Dtos/UserListDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace EntityLayer.Dtos
{
public class UserListDto:DtoGetBase
public class UserListDto : DtoGetBase, IDto
{
public IList<User> Users { get; set; }

Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/UserLoginDto.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class UserLoginDto
public class UserLoginDto : IDto
{
[DisplayName("E-Posta Adresi")]
[Required(ErrorMessage = "{0} boş geçilmemelidir.")]
Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/UserPasswordChangeDto.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class UserPasswordChangeDto
public class UserPasswordChangeDto : IDto
{
[DisplayName("Şu Anki Şifreniz")]
[Required(ErrorMessage = "{0} boş geçilmemelidir.")]
Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/UserRoleAssignDto.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using CoreLayer.Entities.Abstract;

namespace EntityLayer.Dtos
{
public class UserRoleAssignDto
public class UserRoleAssignDto : IDto
{
public UserRoleAssignDto()
{
Expand Down
3 changes: 2 additions & 1 deletion EntityLayer/Dtos/UserUpdateDto.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CoreLayer.Entities.Abstract;
using Microsoft.AspNetCore.Http;

namespace EntityLayer.Dtos
{
public class UserUpdateDto
public class UserUpdateDto : IDto
{
[Required]
public int Id { get; set; }
Expand Down

0 comments on commit 56634ca

Please sign in to comment.