public static FourModel EntityToModel(FourEntity FourEntity) { return(new FourModel { Name = FourEntity.Name, Active = FourEntity.Active }); }
public ActionResult Index(FourModel Model) { FourEntity entity = new FourEntity(); // got from the db FourModelHelper.ModelToEntity(entity, Model); // Save entity to database return(RedirectToAction("Index")); }
public ActionResult Index() { // database gave us this: FourEntity entity = new FourEntity { Name = "Four Thing" }; FourModel model = FourModelHelper.EntityToModel(entity); return(View(model)); }
public static void ModelToEntity(FourEntity FourEntity, FourModel Model) { FourEntity.Name = Model.Name; FourEntity.Active = Model.Active; }