public virtual ActionResult MultipleSelector(int page = 1, string parentpath = null, Guid?parentid = null) { if (!User.Identity.IsAuthenticated && !Metadata.AllowAnonymous) { return(new HttpStatusCodeResult(403)); } if (!Metadata.ViewRoles.All(t => User.IsInRole(t))) { return(new HttpStatusCodeResult(403)); } IQueryable <TEntity> queryable = EntityQueryable.Query(); if (parentpath != null && parentid.HasValue) { try { queryable = EntityQueryable.InParent(queryable, parentpath, parentid.Value); } catch { return(new HttpStatusCodeResult(400)); } } var model = new EntityViewModel <TEntity>(EntityQueryable.OrderBy(queryable), page, 10); if (Metadata.ParentProperty != null) { model.Parent = GetParentModel(parentid, 3); } model.Headers = Metadata.ViewProperties; model.UpdateItems(); return(View(model)); }
public virtual async Task <EntityViewer> GetViewer() { EntityViewModel <TEntity> model = await GetViewModel(EntityQueryable.OrderBy(), 1, 20); EntityViewer viewer = new EntityViewer(); viewer.Model = model; return(viewer); }
public virtual async Task <EntityMultipleSelector> GetMultipleSelector() { EntityViewModel <TEntity> model = await GetMultipleSelectorModel(EntityQueryable.OrderBy()); EntityMultipleSelector selector = new EntityMultipleSelector(); selector.Model = model; return(selector); }