コード例 #1
0
        /// <inheritdoc/>
        public async Task CreateCanvasAsync(CreateCanvasDto canvasDto)
        {
            var canvas = ObjMapper.Map <CreateCanvasDto, Canvas>(canvasDto);

            _unitOfWork.Canvas.Create(canvas);
            await _unitOfWork.SaveAsync();
        }
コード例 #2
0
        /// <inheritdoc/>
        public async Task <PagesListModel <OrderDto> > GetOrderPagesListAsync(OrderQueryParameters parameters)
        {
            var ordersList = await _unitOfWork.Order.GetByQueryParamAsync(parameters);

            var result = ObjMapper.Map <PagesList <Order>, PagesListModel <OrderDto> >(ordersList);

            return(result);
        }
コード例 #3
0
        /// <inheritdoc/>
        public async Task MakeOrderAsync(CreateOrderDto orderDto)
        {
            var order = ObjMapper.Map <CreateOrderDto, Order>(orderDto);

            //order.Canvas = await _unitOfWork.Canvas.FindByIdAsync(orderDto.CanvasId);

            _unitOfWork.Order.Create(order);
            await _unitOfWork.SaveAsync();
        }
コード例 #4
0
        /// <inheritdoc/>
        public async Task <PagesListModel <UserDto> > GetUsersAsync(UserQueryParam param)
        {
            var users          = ObjMapper.Map <IList <User>, IList <UserDto> >(await _userManager.Users.ToListAsync());
            var usersPagesList = await PagesList <UserDto> .GetPagesListAsync(users.AsQueryable(), param);

            foreach (var user in usersPagesList)
            {
                user.Roles = await _rolesService.GetUserRolesAsync(user.Id);
            }

            var result = ObjMapper.Map <PagesList <UserDto>, PagesListModel <UserDto> >(usersPagesList);

            return(result);
        }