Доработки
This commit is contained in:
parent
6e1af50f53
commit
a71e45f305
@ -19,8 +19,7 @@ internal class WorkPieceStorageContract : IWorkPieceStorageContract
|
|||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
var config = new MapperConfiguration(cfg =>
|
var config = new MapperConfiguration(cfg =>
|
||||||
{
|
{
|
||||||
cfg.CreateMap<WorkPiece, WorkPieceDataModel>();
|
cfg.AddMaps(typeof(SoftBedDbContext).Assembly);
|
||||||
cfg.CreateMap<WorkPieceDataModel, WorkPiece>();
|
|
||||||
});
|
});
|
||||||
_mapper = new Mapper(config);
|
_mapper = new Mapper(config);
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,7 @@ internal class WorkerStorageContract : IWorkerStorageContract
|
|||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
var config = new MapperConfiguration(cfg =>
|
var config = new MapperConfiguration(cfg =>
|
||||||
{
|
{
|
||||||
cfg.CreateMap<Worker, WorkerDataModel>();
|
cfg.AddMaps(typeof(SoftBedDbContext).Assembly);
|
||||||
cfg.CreateMap<WorkerDataModel, Worker>();
|
|
||||||
});
|
});
|
||||||
_mapper = new Mapper(config);
|
_mapper = new Mapper(config);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
namespace SoftBedDatabase.Models;
|
||||||
|
|
||||||
|
[AutoMap(typeof(WorkPieceDataModel), ReverseMap = true)]
|
||||||
internal class WorkPiece
|
internal class WorkPiece
|
||||||
{
|
{
|
||||||
public required string Id { get; set; }
|
public required string Id { get; set; }
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using AutoMapper;
|
||||||
|
using SoftBedContracts.DataModels;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace SoftBedDatabase.Models;
|
namespace SoftBedDatabase.Models;
|
||||||
|
|
||||||
|
[AutoMap(typeof(WorkerDataModel), ReverseMap = true)]
|
||||||
internal class Worker
|
internal class Worker
|
||||||
{
|
{
|
||||||
public required string Id { get; set; }
|
public required string Id { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user