Skip to content

Commit b6709a3

Browse files
feat(application) : refactor DTOs and Validators for Improved Modularity
- Restructure Data Transfer Objects (DTOs) into specific namespaces: `CoreXCrud.DTOs.OrderDetailDtos`, `CoreXCrud.DTOs.OrderDtos`, `CoreXCrud.DTOs.ProductDtos`, and `CoreXCrud.DTOs.UserDtos` for better clarity and maintainability. - Update the `MappingProfile` class to include new DTO namespaces and ensure correct mappings between models and DTOs. - Revise validators (`OrderDetailValidator`, `OrderValidator`, `ProductValidator`, and `UserValidator`) to reference the new namespaces. - Modify `Program.cs` to incorporate the updated mappings and validators. - Add migration files (`20250610234634_CreateEntities.cs` and `20250610234634_CreateEntities.Designer.cs`) to set up the database schema for new entities. - Update `appsettings.json` to change the database connection string, reflecting a potential change in the database server. - These changes enhance the organization and modularity of the codebase, making it easier to manage and extend. <-- This commit message was generated with GitHub Copilot in Visual Studio. -->
1 parent 6ee522e commit b6709a3

File tree

17 files changed

+252
-20
lines changed

17 files changed

+252
-20
lines changed

Controllers/OrderDetailsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using AutoMapper;
2-
using CoreXCrud.DTOs;
32
using CoreXCrud.Models;
43
using CoreXCrud.Repositories;
54
using FluentValidation;
65
using Microsoft.AspNetCore.Mvc;
76
using Microsoft.AspNetCore.Authorization;
7+
using CoreXCrud.DTOs.OrderDetailDtos;
88

99
namespace CoreXCrud.Controllers
1010
{

Controllers/OrdersController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using AutoMapper;
2-
using CoreXCrud.DTOs;
32
using CoreXCrud.Models;
43
using CoreXCrud.Repositories;
54
using FluentValidation;
65
using Microsoft.AspNetCore.Mvc;
76
using Microsoft.AspNetCore.Authorization;
87
using Serilog;
8+
using CoreXCrud.DTOs.OrderDtos;
99

1010
namespace CoreXCrud.Controllers
1111
{

Controllers/ProductsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using AutoMapper;
2-
using CoreXCrud.DTOs;
2+
using CoreXCrud.DTOs.ProductDtos;
33
using CoreXCrud.Models;
44
using CoreXCrud.Repositories;
55
using FluentValidation;

Controllers/UsersController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using AutoMapper;
2-
using CoreXCrud.DTOs;
32
using CoreXCrud.Models;
43
using CoreXCrud.Repositories;
54
using FluentValidation;
65
using Microsoft.AspNetCore.Mvc;
76
using Microsoft.AspNetCore.Authorization;
7+
using CoreXCrud.DTOs.UserDtos;
88

99
namespace CoreXCrud.Controllers
1010
{

DTOs/OrderDetailDto.cs renamed to DTOs/OrderDetailDtos/OrderDetailDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace CoreXCrud.DTOs
1+
namespace CoreXCrud.DTOs.OrderDetailDtos
22
{
33
/// <summary>
44
/// Sipariş Detay DTO Modeli

DTOs/OrderDto.cs renamed to DTOs/OrderDtos/OrderDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace CoreXCrud.DTOs
1+
namespace CoreXCrud.DTOs.OrderDtos
22
{
33
/// <summary>
44
/// Sipariş DTO Modeli

DTOs/ProductDto.cs renamed to DTOs/ProductDtos/ProductDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace CoreXCrud.DTOs
1+
namespace CoreXCrud.DTOs.ProductDtos
22
{
33
/// <summary>
44
/// Ürün DTO Modeli

DTOs/UserDto.cs renamed to DTOs/UserDtos/UserDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace CoreXCrud.DTOs
1+
namespace CoreXCrud.DTOs.UserDtos
22
{
33
/// <summary>
44
/// Kullanıcı DTO Modeli

DTOs/MappingProfile.cs renamed to Mappings/MappingProfile.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
using AutoMapper;
2-
using CoreXCrud.DTOs;
2+
using CoreXCrud.DTOs.OrderDetailDtos;
3+
using CoreXCrud.DTOs.OrderDtos;
4+
using CoreXCrud.DTOs.ProductDtos;
5+
using CoreXCrud.DTOs.UserDtos;
36
using CoreXCrud.Models;
47

5-
namespace CoreXCrud.DTOs
8+
namespace CoreXCrud.Mappings
69
{
710
public class MappingProfile : Profile
811
{

Migrations/20250610234634_CreateEntities.Designer.cs

Lines changed: 207 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy