public async Task <int> Create(SparePartSoldCreateDto dto, string userId) { var createdSparePartSold = _mapper.Map <SparePartSoldDbEntity>(dto); await _dbContext.SparePartsSold.AddAsync(createdSparePartSold); await _dbContext.SaveChangesAsync(); return(createdSparePartSold.Id); }
public async Task <IActionResult> Create([FromBody] SparePartSoldCreateDto dto) => await GetResponse(async (userId) => new ApiResponseViewModel(true, "SparePartSold Created Successfully", await _service.Create(dto, userId)));