Initial commit

This commit is contained in:
2023-01-30 09:20:18 +01:00
commit 1b43dd3109
17 changed files with 662 additions and 0 deletions

18
Models/ThuisApiProfile.cs Normal file
View File

@@ -0,0 +1,18 @@
using AutoMapper;
namespace ThuisApi.Models;
public class ThuisApiProfile : Profile
{
public ThuisApiProfile()
{
CreateMap<Freezer, FreezerDto>();
CreateMap<FreezerDto, Freezer>()
.ForMember(dest => dest.FreezerId, opt => opt.Ignore())
.ForSourceMember(src => src.AmountInFreezer, opt => opt.DoNotValidate());
CreateMap<FreezerItem, FreezerItemDto>();
CreateMap<FreezerItemDto, FreezerItem>()
// .ForSourceMember(src => src.Freezer, opt => opt.DoNotValidate())
.ForMember(dest => dest.Freezer, opt => opt.Ignore());
}
}