feat(api): HostController вывод даных из таблицы Unit
This commit is contained in:
@@ -7,6 +7,7 @@ using PARR.Constants.Shortcodes;
|
||||
using PARR.DAL.DomainModels;
|
||||
using PARR.DAL.Extensions;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Models.Unit;
|
||||
|
||||
namespace PARR.API.MappingProfiles
|
||||
{
|
||||
@@ -103,6 +104,21 @@ namespace PARR.API.MappingProfiles
|
||||
|
||||
#endregion
|
||||
|
||||
#region Unit
|
||||
|
||||
CreateMap<UnitInValue, AttributeResponse>()
|
||||
.ForMember(d => d.Id, o => o.MapFrom(s => s.Value!.Id))
|
||||
.ForMember(d => d.Name, o => o.MapFrom(s => (string.IsNullOrEmpty(s.Field!.DisplayName)) ? s.Field!.AihitName : s.Field!.DisplayName))
|
||||
.ForMember(d => d.Value, o => o.MapFrom(s => s.Value!.Value));
|
||||
|
||||
CreateMap<Unit, UnitResponse>()
|
||||
.Include<Unit, UnitWithAttributesResponse>()
|
||||
.ForMember(d => d.Name, o => o.MapFrom(s => s.Name));
|
||||
|
||||
CreateMap<Unit, UnitWithAttributesResponse>()
|
||||
.ForMember(d => d.Attributes, o => o.MapFrom(s => s.UnitValues!.OrderBy(s => (string.IsNullOrEmpty(s.Field!.DisplayName)) ? s.Field!.AihitName : s.Field!.DisplayName)));
|
||||
#endregion
|
||||
|
||||
#region WorkGroup
|
||||
|
||||
CreateMap<WorkGroup, WorkGroupResponse>();
|
||||
|
||||
Reference in New Issue
Block a user