예제 #1
0
        public async Task <int> Create(SaleContractCreateDto dto, string userId)
        {
            var createdSaleContract = _mapper.Map <SaleContractDbEntity>(dto);

            await _dbContext.SaleContracts.AddAsync(createdSaleContract);

            await _dbContext.SaveChangesAsync();

            return(createdSaleContract.Id);
        }
예제 #2
0
 public async Task <IActionResult> Create([FromBody] SaleContractCreateDto dto)
 => await GetResponse(async (userId) =>
                      new ApiResponseViewModel(true, "SaleContract Created Successfully", await _service.Create(dto, userId)));