public void Save(MunicipalityHouseRelation obj)
 {
     if (obj.Id == 0)
         context.Entry(obj).State = System.Data.Entity.EntityState.Added;
     else
         context.Entry(obj).State = System.Data.Entity.EntityState.Modified;
     context.SaveChanges();
 }
Ejemplo n.º 2
0
        public ActionResult AddHouseToMunicipality(MunicipalityHouseRelation obj)
        {
            if(ModelState.IsValid)
            {
                dataManager.MunicipalityHouseRelations.Save(obj);
                return RedirectToAction("Index");
            }

            return View(obj);
        }