CheckPoint -y CheckListTemplateRow
This commit is contained in:
@@ -22,9 +22,10 @@ namespace WorkFlowCheck.BL.Mappings
|
||||
CreateMap<CheckListTemplateHeader, CheckListTemplateHeaderDTO>()
|
||||
.ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRows));
|
||||
CreateMap<CheckListTemplateRow, CheckListTemplateRowDTO>();
|
||||
CreateMap<CheckPoint, CheckPointDTO>();
|
||||
CreateMap<CheckPoint, CheckPointDTO>().ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRows));
|
||||
CreateMap<Location, LocationDTO>();
|
||||
CreateMap<Equipment, EquipmentDTO>();
|
||||
|
||||
CreateMap<CheckListHeader, CheckListHeaderDTO>()
|
||||
.ForMember(dest => dest.CheckListRowDTO, opt => opt.MapFrom(src => src.CheckListRows));
|
||||
}
|
||||
|
||||
@@ -27,7 +27,10 @@ namespace WorkFlowCheck.BL.Services
|
||||
|
||||
try
|
||||
{
|
||||
var res = await _dbContext.CheckPoints.ToListAsync();
|
||||
var res = await _dbContext.CheckPoints
|
||||
.Include(i => i.CheckListTemplateRows)
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
if (res != null)
|
||||
{
|
||||
retVal = _mapper.Map<List<CheckPointDTO>>(res);
|
||||
|
||||
@@ -6,5 +6,6 @@ namespace WorkFlowCheck.Common.DTO
|
||||
public int Id { get; set; }
|
||||
public string ShortName { get; set; }
|
||||
public string Code { get; set; }
|
||||
public List<CheckListTemplateRowDTO> CheckListTemplateRowDTO { get; set; } = new List<CheckListTemplateRowDTO>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,5 +17,8 @@ namespace WorkFlowCheck.DL.Entities
|
||||
public string LastModBy { get; set; } = null!;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public string CreatedBy { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<CheckListTemplateRow> CheckListTemplateRows { get; set; } = new List<CheckListTemplateRow>();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user