Example #1
0
 /// <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);
 }
Example #2
0
        /// <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);
        }