Exemplo n.º 1
0
 public ActionResult Index()
 {
     using (VolunteerOpportunityDBContext db = new VolunteerOpportunityDBContext())
     {
         return(View(db.VO.ToList()));
     }
 }
Exemplo n.º 2
0
 public ActionResult AddOpportunity(VolunteerOpportunity vo)
 {
     if (ModelState.IsValid)
     {
         using (VolunteerOpportunityDBContext db = new VolunteerOpportunityDBContext())
         {
             db.VO.Add(vo);
             db.SaveChanges();
         }
         ModelState.Clear();
     }
     return(View());
 }