Ejemplo n.º 1
0
 public ActionResult Edit(CachedResource cr)
 {
     ViewData.Model = cr;
     cr.Load();
     //return Edit();
     return View();
 }
Ejemplo n.º 2
0
        //
        // GET: /resource
        // this is not an override since that would require a parameter downcast.
        // base method is no-arg now anyway.
        // *NOTE*, consider replacing Index with Get() and List()...
        // TODO: check redirect to ModelType.Name Route before doing this.
        public ActionResult Index(CachedResource cr)
        {
            // TODO: set different View for List and single-item detail...current view changes on model type.
            // then call base.List() or base.Get()

            if (cr.Id == Guid.Empty)
            {
                ViewData.Model = cr.List();
            }
            else
            {
                ViewData.Model = cr;
                cr.Load();
            }
            //return Index(); // base.Index()
            return View();
        }
Ejemplo n.º 3
0
 public ActionResult Update(CachedResource cr)
 {
     ViewData.Model = cr;
     cr.Update();
     return Update();
 }
Ejemplo n.º 4
0
 public ActionResult Delete(CachedResource cr)
 {
     ViewData.Model = cr;
     cr.Delete();
     return Delete();
 }
Ejemplo n.º 5
0
 public ActionResult Create(CachedResource cr)
 {
     ViewData.Model = cr;
     cr.Create();
     return Create();
 }