/// <summary> /// Maps a <see cref='Altask.Data.Model.AssetType'/> object to a <see cref='Altask.Data.Dto.AssetType'/> object. /// </summary> public static Altask.Data.Dto.AssetType ToDto(this Altask.Data.Model.AssetType entity) { var dto = new Altask.Data.Dto.AssetType(); dto.Id = entity.Id; dto.Active = entity.Active; dto.Name = entity.Name; dto.Description = entity.Description; dto.Value = entity.Value; dto.System = entity.System; return(dto); }
internal static void NotifyAssetTypeUpdate(Guid?clientId, Altask.Data.Dto.AssetType assetType) { if (!clientId.HasValue) { _context.Clients.All.notifyAssetTypeUpdate(new { assetType = assetType }); } else { SignalRConnection connection; if (_connections.TryGetValue(clientId.Value, out connection)) { _context.Clients.AllExcept(connection.ConnectionId).notifyAssetTypeUpdate(new { connection = connection, assetType = assetType }); } else { _context.Clients.All.notifyAssetTypeCreate(new { assetType = assetType }); } } }
/// <summary> /// Maps all the non-primary key and tracking properties of a <see cref='Altask.Data.Dto.AssetType'/> object to a <see cref='Altask.Data.Model.AssetType'/> object. /// </summary> public static Altask.Data.Model.AssetType FromDto(this Altask.Data.Model.AssetType model, Altask.Data.Dto.AssetType entity) { model.Active = entity.Active; model.Name = entity.Name; model.Description = entity.Description; model.Value = entity.Value; model.System = entity.System; return(model); }