Exemple #1
0
 public static IResource <int> FromDto(ResourceDto dto)
 {
     if (dto == null)
     {
         throw new ArgumentNullException(nameof(dto));
     }
     return(new Resource <int>(
                dto.Id,
                dto.Name,
                dto.IsExplicitTarget,
                dto.InterActivityAllocationType,
                dto.UnitCost,
                dto.DisplayOrder));
 }
Exemple #2
0
 public static ResourceDto Copy(this ResourceDto resourceDto)
 {
     if (resourceDto == null)
     {
         throw new ArgumentNullException(nameof(resourceDto));
     }
     return(new ResourceDto
     {
         Id = resourceDto.Id,
         Name = resourceDto.Name,
         IsExplicitTarget = resourceDto.IsExplicitTarget,
         InterActivityAllocationType = resourceDto.InterActivityAllocationType,
         UnitCost = resourceDto.UnitCost,
         DisplayOrder = resourceDto.DisplayOrder,
         ColorFormat = resourceDto.ColorFormat != null?resourceDto.ColorFormat.Copy() : new ColorFormatDto()
     });
 }