This project is read-only.

_contentManager.UpdateEditor return error

Topics: Customizing Orchard
Nov 17, 2011 at 7:58 PM


Here is my createpost code

 public ActionResult CreatePOST()
            if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not authorized to manage Categories")))
                return new HttpUnauthorizedResult();

            var Category = Services.ContentManager.New<CategoryPart>("Category");

            _contentManager.Create(Category, VersionOptions.Published);
            dynamic model = _contentManager.UpdateEditor(Category, this);

            if (!ModelState.IsValid)
                // Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
               // return View((object)model);
                return View ();


            return Redirect(Url.Content("Category/admin"));

 dynamic model = _contentManager.UpdateEditor(Category, this);

This line return error
Error 1 The best overloaded method match for 'Orchard.ContentManagement.IContentManager.UpdateEditor(Orchard.ContentManagement.IContent, Orchard.ContentManagement.IUpdateModel, string)' has some invalid arguments E:\Arruni\Arruni\Sean Baumann\Orchard\src\Orchard.Web\Modules\eProp.Category\Controllers\AdminController.cs 142 29 eProp.Category

But i copy code from blogadmincontroller, At blogadmin code is working. Only my controller its not working


Nov 17, 2011 at 8:03 PM

Your controller needs to implement IUpdateModel, you can see the implementation towards the end of BlogController (TryUpdateModel and AddModelError)