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

            dto.Id   = entity.Id;
            dto.Name = entity.Name;

            return(dto);
        }
コード例 #2
0
        internal static void NotifyRoleUpdate(Guid?clientId, Altask.Data.Dto.Role role)
        {
            if (!clientId.HasValue)
            {
                _context.Clients.All.notifyRoleUpdate(new { role = role });
            }
            else
            {
                SignalRConnection connection;

                if (_connections.TryGetValue(clientId.Value, out connection))
                {
                    _context.Clients.AllExcept(connection.ConnectionId).notifyRoleUpdate(new { connection = connection, role = role });
                }
                else
                {
                    _context.Clients.All.notifyRoleCreate(new { role = role });
                }
            }
        }
コード例 #3
0
 /// <summary>
 /// Maps all the non-primary key and tracking properties of a <see cref='Altask.Data.Dto.Role'/> object to a <see cref='Altask.Data.Model.Role'/> object.
 /// </summary>
 public static Altask.Data.Model.Role FromDto(this Altask.Data.Model.Role model, Altask.Data.Dto.Role entity)
 {
     model.Name = entity.Name;
     return(model);
 }