Exemple #1
0
        public ActionResult Index()
        {
            List <Mahasiswa> r;

            using (var s = new SimEntities())
            {
                r = s.Mahasiswa.ToList();
            }
            return(View(r));
        }
Exemple #2
0
        public ActionResult Create_Post()
        {
            var model = new Mahasiswa();

            TryUpdateModel(model);
            using (var s = new SimEntities())
            {
                s.Mahasiswa.Add(model);
                s.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }
Exemple #3
0
 public void RemoveEntity(Simulation.Events.EventReceiver s)
 {
     SimEntities.Remove(s);
 }
Exemple #4
0
 public void AddEntity(Simulation.Events.EventReceiver s)
 {
     SimEntities.Add(s);
 }