Access to AppData folder within migration class

Topics: Core, Customizing Orchard, General
Oct 23, 2014 at 2:16 PM
Edited Oct 23, 2014 at 2:16 PM

How can I access to AppData folder within migration process? Is that even possible?
Oct 25, 2014 at 12:10 AM
Yes, you can access the App_Data folder anywhere through the injectable IAppDataFolder service.
Oct 27, 2014 at 12:01 PM
Thank you, Piedone!

I've used HostingEnvironment.ApplicationPhysicalPath instead, and I think IAppDataFolder service is using HostingEnvironment as well
Oct 27, 2014 at 5:18 PM
You can certainly do that but IAppDataFolder, being an injectable interface dependency, is generally better because of loose coupling.
Oct 27, 2014 at 8:35 PM
Yes, you right. In general, it is better, but in case of using it within a single migration method, it will be overkill, I think.