/// <summary> /// Maps a <see cref='Altask.Data.Model.UserRole'/> object to a <see cref='Altask.Data.Dto.UserRole'/> object. /// </summary> /// <param name="includeLogs">Indicates whether to load any logs associated with the object when mapping.</param> public static Altask.Data.Dto.UserRole ToDto(this Altask.Data.Model.UserRole entity, bool includeLogs = false) { var dto = new Altask.Data.Dto.UserRole(); dto.Id = entity.Id; dto.UserId = entity.UserId; dto.RoleId = entity.RoleId; dto.Name = entity.Name; dto.CreatedBy = entity.CreatedBy; dto.CreatedOn = entity.CreatedOn; dto.UpdatedBy = entity.UpdatedBy; dto.UpdatedOn = entity.UpdatedOn; if (entity.Role != null) { dto.Role = entity.Role.ToDto(); } return(dto); }
internal static void NotifyUserRoleUpdate(Guid?clientId, Altask.Data.Dto.UserRole userRole) { if (!clientId.HasValue) { _context.Clients.All.notifyUserRoleUpdate(new { userRole = userRole }); } else { SignalRConnection connection; if (_connections.TryGetValue(clientId.Value, out connection)) { _context.Clients.AllExcept(connection.ConnectionId).notifyUserRoleUpdate(new { connection = connection, userRole = userRole }); } else { _context.Clients.All.notifyUserRoleCreate(new { userRole = userRole }); } } }
/// <summary> /// Maps all the non-primary key and tracking properties of a <see cref='Altask.Data.Dto.UserRole'/> object to a <see cref='Altask.Data.Model.UserRole'/> object. /// </summary> public static Altask.Data.Model.UserRole FromDto(this Altask.Data.Model.UserRole model, Altask.Data.Dto.UserRole entity) { model.UserId = entity.UserId; model.RoleId = entity.RoleId; model.Name = entity.Name; return(model); }