public async Task <HttpResponseMessage> AddNewAsync(RailwayJsonModel model) { if (model == null) { return(new HttpResponseMessage(HttpStatusCode.BadRequest)); } var railway = new Railway { Id = model.ID, Code = model.Code, Name = model.Name, ShortName = model.ShortName, TelegraphName = model.TelegraphName, DateCreate = model.DateCreate, DateUpdate = model.DateUpdate, CountryId = model.CountryID }; await _context.AddAsync(railway); await _context.SaveChangesAsync(); return(new HttpResponseMessage(HttpStatusCode.OK)); }