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

            dto.Id            = entity.Id;
            dto.FormId        = entity.FormId;
            dto.Type          = entity.Type;
            dto.Description   = entity.Description;
            dto.BeforeModel   = entity.BeforeModel;
            dto.BeforeVersion = entity.BeforeVersion;
            dto.AfterModel    = entity.AfterModel;
            dto.AfterVersion  = entity.AfterVersion;
            dto.CreatedBy     = entity.CreatedBy;
            dto.CreatedOn     = entity.CreatedOn;
            dto.UpdatedBy     = entity.UpdatedBy;
            dto.UpdatedOn     = entity.UpdatedOn;

            return(dto);
        }
Пример #2
0
        internal static void NotifyFormLogUpdate(Guid?clientId, Altask.Data.Dto.FormLog formLog)
        {
            if (!clientId.HasValue)
            {
                _context.Clients.All.notifyFormLogUpdate(new { formLog = formLog });
            }
            else
            {
                SignalRConnection connection;

                if (_connections.TryGetValue(clientId.Value, out connection))
                {
                    _context.Clients.AllExcept(connection.ConnectionId).notifyFormLogUpdate(new { connection = connection, formLog = formLog });
                }
                else
                {
                    _context.Clients.All.notifyFormLogCreate(new { formLog = formLog });
                }
            }
        }
Пример #3
0
 /// <summary>
 /// Maps all the non-primary key and tracking properties of a <see cref='Altask.Data.Dto.FormLog'/> object to a <see cref='Altask.Data.Model.FormLog'/> object.
 /// </summary>
 public static Altask.Data.Model.FormLog FromDto(this Altask.Data.Model.FormLog model, Altask.Data.Dto.FormLog entity)
 {
     model.FormId        = entity.FormId;
     model.Type          = entity.Type;
     model.Description   = entity.Description;
     model.BeforeModel   = entity.BeforeModel;
     model.BeforeVersion = entity.BeforeVersion;
     model.AfterModel    = entity.AfterModel;
     model.AfterVersion  = entity.AfterVersion;
     return(model);
 }