示例#1
0
        public static BookedItem CreateEntity(DTO.BookedItemDto Dto)
        {
            if (Dto == null)
            {
                return(null);
            }

            var entity = new BookedItem()
            {
                Quantity     = Dto.Quantity,
                BookedItemId = Dto.BookedItemId,
                EndTime      = Dto.EndTime,
                StartTime    = Dto.EndTime,
                ClientId     = Dto.ClientId ?? 0,
                ItemId       = Dto.ItemId ?? 0,
            };

            return(entity);
        }
示例#2
0
        public static DTO.BookedItemDto CreateModel(BookedItem entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var model = new DTO.BookedItemDto()
            {
                Quantity     = entity.Quantity,
                BookedItemId = entity.BookedItemId,
                EndTime      = entity.EndTime,
                ClientId     = entity.Client.ClientId,
                ItemId       = entity.Item.ItemId,
                StartTime    = entity.StartTime
            };

            return(model);
        }