public virtual IActionResult Post([FromBody] TMap entity)
        {
            var item   = mapper.Map <TEntity>(entity);
            var result = service.Add(item);

            return(Created("Get", mapper.Map <TMap>(result)));
        }
Example #2
0
        public async Task <OrderDTO> Add(OrderDTO data)
        {
            var order = new Order
            {
                ProductCount = data.Count,
                ProductId    = data.ProductId,
                ClientId     = data.ClientId
            };

            order = await orders.Add(order);

            return((await GetAsync(order.OrderId)).FirstOrDefault());
        }