Пример #1
0
 public static FourModel EntityToModel(FourEntity FourEntity)
 {
     return(new FourModel {
         Name = FourEntity.Name,
         Active = FourEntity.Active
     });
 }
Пример #2
0
        public ActionResult Index(FourModel Model)
        {
            FourEntity entity = new FourEntity();             // got from the db

            FourModelHelper.ModelToEntity(entity, Model);
            // Save entity to database
            return(RedirectToAction("Index"));
        }
Пример #3
0
        public ActionResult Index()
        {
            // database gave us this:
            FourEntity entity = new FourEntity {
                Name = "Four Thing"
            };
            FourModel model = FourModelHelper.EntityToModel(entity);

            return(View(model));
        }
Пример #4
0
 public static void ModelToEntity(FourEntity FourEntity, FourModel Model)
 {
     FourEntity.Name   = Model.Name;
     FourEntity.Active = Model.Active;
 }