Beispiel #1
0
        public async Task <int> Create(CreateContractDto dto, string userId)
        {
            var createdContract = _mapper.Map <ContractDbEntity>(dto);

            createdContract.CreatedBy = userId;

            await _dbContext.Contract.AddAsync(createdContract);

            await _dbContext.SaveChangesAsync();

            return(createdContract.Id);
        }
 public async Task <IActionResult> Create([FromBody] CreateContractDto dto)
 => await GetResponse(async() =>
                      new ApiResponseViewModel(true, "Contract Created Successfully",
                                               await _contractsService.Create(dto, UserId)));