public void Delete([FromBody] Country deletedCountry) { var context = new trackingContext(); var country = context.Country.Where(c => c.Id == deletedCountry.Id).SingleOrDefault(); context.Remove <Country>(country); context.SaveChanges(); }
public void Put([FromBody] Country updatedCountry) { var context = new trackingContext(); var country = context.Country.Where(c => c.Id == updatedCountry.Id).SingleOrDefault(); country.Name = updatedCountry.Name; context.Update <Country>(country); context.SaveChanges(); }
public void Post([FromBody] Country country) { var context = new trackingContext(); var newCountry = new Country { Name = country.Name }; context.Add <Country>(newCountry); context.SaveChanges(); }
public VehiclebrandController(trackingContext context) : base(context) { }
public DriverController(trackingContext context) : base(context) { }
public SuperController(trackingContext context) { dbContext = context; }
public AlertController(trackingContext context) : base(context) { }