Feature request: BaseController Implementation

Topics: Core, Writing modules
Nov 12, 2011 at 2:14 PM
Edited Nov 12, 2011 at 2:25 PM

I find it trivial every time I need to create a new Controller to copy/paste existing controller's implementation. I think it's better to include a base implementation that consists of a constructor that takes at least an IOrchardServices parameter, and a couple of properties (Logger & Localizer), & other stuff that might be useful!

Nov 13, 2011 at 1:24 PM

and also for ContentPartDriver<T>

for ex this function(from bertrandleroy) can be added 

private TV GetAttribute<TV>(ImportContentContext context, string partName, string elementName)
            string value = context.Attribute(partName, elementName);
            if (value != null)
                return (TV)Convert.ChangeType(value, typeof(TV));
            return default(TV);
Nov 15, 2011 at 1:16 AM

That's by design. Feel free to create such a base class for your own usage.