Skip to content

Commit fe28def

Browse files
committed
Mapper
Automapper changed
1 parent c9910db commit fe28def

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Supermarket/Mapping/ModelToResourceProfile.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
using AutoMapper;
22
using Supermarket.Core.Models;
33
using Supermarket.Extensions;
4-
using Supermarket.Resources;
4+
using Supermarket.V1.Dtos.AccountDtos;
5+
using Supermarket.V1.Dtos.CategoryDtos;
6+
using Supermarket.V1.Dtos.ProductDtos;
57

68
namespace Supermarket.Mapping
79
{
810
public class ModelToResourceProfile : Profile
911
{
1012
public ModelToResourceProfile()
1113
{
12-
CreateMap<ApplicationUser, UserProfileResource>();
14+
CreateMap<ApplicationUser, UserInfoDto>();
1315

14-
CreateMap<Category, CategoryResource>();
16+
CreateMap<Category, CategoryDto>();
1517

16-
CreateMap<Product, ProductResource>()
18+
CreateMap<Product, ProductDto>()
1719
.ForMember(src => src.UnitOfMeasurement,
1820
opt => opt.MapFrom(src => src.UnitOfMeasurement.ToDescriptionString()));
1921
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
using AutoMapper;
22
using Supermarket.Core.Models;
33
using Supermarket.Resources;
4+
using Supermarket.V1.Dtos.CategoryDtos;
45

56
namespace Supermarket.Mapping
67
{
78
public class ResourceToModelProfile : Profile
89
{
910
public ResourceToModelProfile()
1011
{
11-
CreateMap<SaveCategoryResource, Category>();
12+
CreateMap<CreateCategoryDto, Category>();
1213
}
1314
}
1415
}

0 commit comments

Comments
 (0)