Доработки

This commit is contained in:
rakhaliullov 2025-03-12 12:22:49 +04:00
parent 6e1af50f53
commit a71e45f305
4 changed files with 11 additions and 6 deletions

View File

@ -19,8 +19,7 @@ internal class WorkPieceStorageContract : IWorkPieceStorageContract
_dbContext = dbContext;
var config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<WorkPiece, WorkPieceDataModel>();
cfg.CreateMap<WorkPieceDataModel, WorkPiece>();
cfg.AddMaps(typeof(SoftBedDbContext).Assembly);
});
_mapper = new Mapper(config);
}

View File

@ -16,8 +16,7 @@ internal class WorkerStorageContract : IWorkerStorageContract
_dbContext = dbContext;
var config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<Worker, WorkerDataModel>();
cfg.CreateMap<WorkerDataModel, Worker>();
cfg.AddMaps(typeof(SoftBedDbContext).Assembly);
});
_mapper = new Mapper(config);
}

View File

@ -1,7 +1,11 @@
using System.ComponentModel.DataAnnotations.Schema;
using AutoMapper;
using SoftBedContracts.DataModels;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.InteropServices;
namespace SoftBedDatabase.Models;
[AutoMap(typeof(WorkPieceDataModel), ReverseMap = true)]
internal class WorkPiece
{
public required string Id { get; set; }

View File

@ -1,7 +1,10 @@
using System.ComponentModel.DataAnnotations.Schema;
using AutoMapper;
using SoftBedContracts.DataModels;
using System.ComponentModel.DataAnnotations.Schema;
namespace SoftBedDatabase.Models;
[AutoMap(typeof(WorkerDataModel), ReverseMap = true)]
internal class Worker
{
public required string Id { get; set; }