コード例 #1
0
ファイル: PriceOfferService.cs プロジェクト: DevMosaAlhaj/AMS
        public async Task <int> Create(PriceOfferCreateDto dto, string userId)
        {
            var createdPriceOffer = _mapper.Map <PriceOfferDbEntity>(dto);

            await _dbContext.PriceOffers.AddAsync(createdPriceOffer);

            await _dbContext.SaveChangesAsync();

            return(createdPriceOffer.Id);
        }
コード例 #2
0
 public async Task <IActionResult> Create([FromBody] PriceOfferCreateDto dto)
 => await GetResponse(async (userId) =>
                      new ApiResponseViewModel(true, "PriceOffer Created Successfully", await _service.Create(dto, userId)));