예제 #1
0
        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)));
        }
예제 #2
0
 public async Task AddCarHistoryDbAsync(CarHistoryModel carHistoryModel)
 {
     await _client.PostAsJsonAsync("api/history", carHistoryModel);
 }