Beispiel #1
0
        /// <summary>
        /// Maps a <see cref='Altask.Data.Model.ScheduleAsset'/> object to a <see cref='Altask.Data.Dto.ScheduleAsset'/> object.
        /// </summary>
        /// <param name="includeLogs">Indicates whether to load any logs associated with the object when mapping.</param>
        public static Altask.Data.Dto.ScheduleAsset ToDto(this Altask.Data.Model.ScheduleAsset entity, bool includeLogs = false)
        {
            var dto = new Altask.Data.Dto.ScheduleAsset();

            dto.Id                  = entity.Id;
            dto.ScheduleId          = entity.ScheduleId;
            dto.AssetId             = entity.AssetId;
            dto.ScheduleAssetTypeId = entity.ScheduleAssetTypeId;
            dto.CreatedBy           = entity.CreatedBy;
            dto.CreatedOn           = entity.CreatedOn;
            dto.UpdatedBy           = entity.UpdatedBy;
            dto.UpdatedOn           = entity.UpdatedOn;

            if (entity.Asset != null)
            {
                dto.Asset = entity.Asset.ToDto();
            }

            if (entity.Type != null)
            {
                dto.Type = entity.Type.ToDto();
            }

            return(dto);
        }
Beispiel #2
0
 /// <summary>
 /// Maps all the non-primary key and tracking properties of a <see cref='Altask.Data.Dto.ScheduleAsset'/> object to a <see cref='Altask.Data.Model.ScheduleAsset'/> object.
 /// </summary>
 public static Altask.Data.Model.ScheduleAsset FromDto(this Altask.Data.Model.ScheduleAsset model, Altask.Data.Dto.ScheduleAsset entity)
 {
     model.ScheduleId          = entity.ScheduleId;
     model.AssetId             = entity.AssetId;
     model.ScheduleAssetTypeId = entity.ScheduleAssetTypeId;
     return(model);
 }