public async Task <IHttpActionResult> Add() { var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "MunicipalitiesDataJson", "MunicipalietiesTaxes.json"); using (var r = new StreamReader(path ?? throw new InvalidOperationException())) { var json = r.ReadToEnd(); var items = JsonConvert.DeserializeObject <List <TaxDto> >(json); if (await _taxesService.AddRangeTaxes(items)) { return(Ok("Successfuly added")); } return(BadRequest("Something get wrong")); } }