Medium trust: Avoiding dynamic dispatch to the view method (which is protected internal) and using static invocation by casting to object.

--HG--
branch : dev
This commit is contained in:
andrerod
2010-11-17 22:56:52 -08:00
parent f729293337
commit 26ce8f8243
5 changed files with 22 additions and 24 deletions

View File

@@ -57,10 +57,10 @@ namespace Orchard.Users.Controllers {
var user = Services.ContentManager.New<IUser>("User");
var editor = Shape.EditorTemplate(TemplateName: "Parts/User.Create", Model: new UserCreateViewModel(), Prefix: null);
editor.Metadata.Position = "2";
var model = Services.ContentManager.BuildEditor(user);
dynamic model = Services.ContentManager.BuildEditor(user);
model.Content.Add(editor);
return View(model);
return View((object)model);
}
[HttpPost, ActionName("Create")]
@@ -111,10 +111,10 @@ namespace Orchard.Users.Controllers {
var user = Services.ContentManager.Get<UserPart>(id);
var editor = Shape.EditorTemplate(TemplateName: "Parts/User.Edit", Model: new UserEditViewModel {User = user}, Prefix: null);
editor.Metadata.Position = "2";
var model = Services.ContentManager.BuildEditor(user);
dynamic model = Services.ContentManager.BuildEditor(user);
model.Content.Add(editor);
return View(model);
return View((object)model);
}
[HttpPost, ActionName("Edit")]