Ejemplo n.º 1
0
        private static AuditItemGroupModel CreateAuditGroup(ushort order, string title,
                                                            IEnumerable <AuditItemModel> items)
        {
            var group = new AuditItemGroupModel(items);

            group.Order = order;
            group.Title = title;
            return(group);
        }
        public static AuditItemGroupModel CreateModel(this AuditItemGroupDto dto)
        {
            var items = dto.Items.Select(x => x.CreateModel()).ToList();
            var model = new AuditItemGroupModel(items)
            {
                Order = dto.Order,
                Title = dto.Title
            };

            return(model);
        }
        public static AuditItemGroupDto CreateDto(this AuditItemGroupModel model)
        {
            var dto = new AuditItemGroupDto
            {
                Order = model.Order,
                Title = model.Title,
                Items = model.Items.Select(x => x.CreateDto()).ToList()
            };

            return(dto);
        }