Example #1
0
        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();
        }
Example #2
0
        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();
        }
Example #3
0
        public void Post([FromBody] Country country)
        {
            var context = new trackingContext();

            var newCountry = new Country
            {
                Name = country.Name
            };

            context.Add <Country>(newCountry);
            context.SaveChanges();
        }
Example #4
0
 public VehiclebrandController(trackingContext context) : base(context)
 {
 }
Example #5
0
 public DriverController(trackingContext context) : base(context)
 {
 }
Example #6
0
 public SuperController(trackingContext context)
 {
     dbContext = context;
 }
Example #7
0
 public AlertController(trackingContext context) : base(context)
 {
 }