Access to AppData folder within migration class

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

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

I've used HostingEnvironment.ApplicationPhysicalPath instead, and I think IAppDataFolder service is using HostingEnvironment as well
Oct 27, 2014 at 4: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 7: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.