public async Task <JsonResult> AddCarDb(CarHistoryModel carHistoryModel) { if (carHistoryModel is null) { return(new(new Either <bool, Error>(false, Errors.CarWasNull))); } var car = _mapper.Map <CarHistory>(carHistoryModel); _repository.Add(car); await _repository.SaveAsync(); return(new(new Either <bool, Error>(true, null))); }
public async Task AddCarHistoryDbAsync(CarHistoryModel carHistoryModel) { await _client.PostAsJsonAsync("api/history", carHistoryModel); }