コード例 #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();
        }
コード例 #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();
        }
コード例 #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();
        }
コード例 #4
0
 public VehiclebrandController(trackingContext context) : base(context)
 {
 }
コード例 #5
0
 public DriverController(trackingContext context) : base(context)
 {
 }
コード例 #6
0
 public SuperController(trackingContext context)
 {
     dbContext = context;
 }
コード例 #7
0
 public AlertController(trackingContext context) : base(context)
 {
 }