допил аттрибутов automap
This commit is contained in:
@@ -21,8 +21,7 @@ public ManufacturerStorageContract(SmallSoftwareDbContext dbContext)
|
||||
_dbContext = dbContext;
|
||||
var config = new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<Manufacturer, ManufacturerDataModel>();
|
||||
cfg.CreateMap<ManufacturerDataModel, Manufacturer>();
|
||||
cfg.AddMaps(typeof(Manufacturer));
|
||||
});
|
||||
_mapper = new Mapper(config);
|
||||
}
|
||||
|
||||
@@ -20,8 +20,7 @@ internal class WorkerStorageContract : IWorkerStorageContract
|
||||
_dbContext = dbContext;
|
||||
var config = new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<Worker, WorkerDataModel>();
|
||||
cfg.CreateMap<WorkerDataModel, Worker>();
|
||||
cfg.AddMaps(typeof(Worker).Assembly);
|
||||
});
|
||||
_mapper = new Mapper(config);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using SmallSoftwareContracts.DataModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
@@ -7,6 +9,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SmallSoftwareDatabase.Models;
|
||||
|
||||
[AutoMap(typeof(ManufacturerDataModel), ReverseMap = true)]
|
||||
internal class Manufacturer
|
||||
{
|
||||
public required string Id { get; set; }
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using SmallSoftwareContracts.DataModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
@@ -6,7 +8,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SmallSoftwareDatabase.Models;
|
||||
|
||||
[AutoMap(typeof(WorkerDataModel), ReverseMap = true)]
|
||||
internal class Worker
|
||||
{
|
||||
public required string Id { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user