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

            dto.Id          = entity.Id;
            dto.Active      = entity.Active;
            dto.Name        = entity.Name;
            dto.Description = entity.Description;

            return(dto);
        }
Example #2
0
        internal static void NotifyManufacturerUpdate(Guid?clientId, Altask.Data.Dto.Manufacturer manufacturer)
        {
            if (!clientId.HasValue)
            {
                _context.Clients.All.notifyManufacturerUpdate(new { manufacturer = manufacturer });
            }
            else
            {
                SignalRConnection connection;

                if (_connections.TryGetValue(clientId.Value, out connection))
                {
                    _context.Clients.AllExcept(connection.ConnectionId).notifyManufacturerUpdate(new { connection = connection, manufacturer = manufacturer });
                }
                else
                {
                    _context.Clients.All.notifyManufacturerCreate(new { manufacturer = manufacturer });
                }
            }
        }
Example #3
0
 /// <summary>
 /// Maps all the non-primary key and tracking properties of a <see cref='Altask.Data.Dto.Manufacturer'/> object to a <see cref='Altask.Data.Model.Manufacturer'/> object.
 /// </summary>
 public static Altask.Data.Model.Manufacturer FromDto(this Altask.Data.Model.Manufacturer model, Altask.Data.Dto.Manufacturer entity)
 {
     model.Active      = entity.Active;
     model.Name        = entity.Name;
     model.Description = entity.Description;
     return(model);
 }