Esempio n. 1
0
        //[Route("{entityTypeName}/{id:int}/details")]
        public ActionResult Details(string entityTypeName, int id)
        {
            var entity = CoreExtensions.GetDisplayable(DbContext, entityTypeName, id);

            if (entity == null)
            {
                return(Redirect("/"));
            }

            if (entity is IProtectedAccess)
            {
                if (!(entity as IProtectedAccess).AccessibleTo(User, DbContext))
                {
                    return(View("Unauthorize"));
                }
            }

            return(View(entity));
        }