-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDataStorageMappingProfile.cs
More file actions
24 lines (19 loc) · 997 Bytes
/
DataStorageMappingProfile.cs
File metadata and controls
24 lines (19 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
namespace Keeptrack.WebApi.MappingProfiles;
public class DataStorageMappingProfile : Profile
{
public override string ProfileName
{
get { return "KeeptrackDataStorageMappingProfile"; }
}
public DataStorageMappingProfile()
{
CreateMap<Infrastructure.MongoDb.Entities.Book, Domain.Models.BookModel>();
CreateMap<Domain.Models.BookModel, Infrastructure.MongoDb.Entities.Book>();
CreateMap<Infrastructure.MongoDb.Entities.TvShow, Domain.Models.TvShowModel>();
CreateMap<Domain.Models.TvShowModel, Infrastructure.MongoDb.Entities.TvShow>();
CreateMap<Infrastructure.MongoDb.Entities.VideoGame, Domain.Models.VideoGameModel>();
CreateMap<Domain.Models.VideoGameModel, Infrastructure.MongoDb.Entities.VideoGame>();
CreateMap<DateTime, DateOnly>().ConvertUsing(dt => DateOnly.FromDateTime(dt));
CreateMap<DateOnly, DateTime>().ConvertUsing(d => d.ToDateTime(TimeOnly.MinValue, DateTimeKind.Utc));
}
}