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); }
public async Task <IActionResult> Create([FromBody] SaleContractCreateDto dto) => await GetResponse(async (userId) => new ApiResponseViewModel(true, "SaleContract Created Successfully", await _service.Create(dto, userId)));