/// <summary> /// Maps a <see cref='Altask.Data.Model.AssetGrouping'/> object to a <see cref='Altask.Data.Dto.AssetGrouping'/> object. /// </summary> public static Altask.Data.Dto.AssetGrouping ToDto(this Altask.Data.Model.AssetGrouping entity) { var dto = new Altask.Data.Dto.AssetGrouping(); dto.Id = entity.Id; dto.AssetId = entity.AssetId; dto.AssetGroupId = entity.AssetGroupId; dto.CreatedBy = entity.CreatedBy; dto.CreatedOn = entity.CreatedOn; dto.UpdatedBy = entity.UpdatedBy; dto.UpdatedOn = entity.UpdatedOn; if (entity.Group != null) { dto.Group = entity.Group.ToDto(); } return(dto); }
internal static void NotifyAssetGroupingUpdate(Guid?clientId, Altask.Data.Dto.AssetGrouping assetGrouping) { if (!clientId.HasValue) { _context.Clients.All.notifyAssetGroupingUpdate(new { assetGrouping = assetGrouping }); } else { SignalRConnection connection; if (_connections.TryGetValue(clientId.Value, out connection)) { _context.Clients.AllExcept(connection.ConnectionId).notifyAssetGroupingUpdate(new { connection = connection, assetGrouping = assetGrouping }); } else { _context.Clients.All.notifyAssetGroupingCreate(new { assetGrouping = assetGrouping }); } } }
/// <summary> /// Maps all the non-primary key and tracking properties of a <see cref='Altask.Data.Dto.AssetGrouping'/> object to a <see cref='Altask.Data.Model.AssetGrouping'/> object. /// </summary> public static Altask.Data.Model.AssetGrouping FromDto(this Altask.Data.Model.AssetGrouping model, Altask.Data.Dto.AssetGrouping entity) { model.AssetId = entity.AssetId; model.AssetGroupId = entity.AssetGroupId; return(model); }