Creating Instances Of Content Types in Migration.cs

Topics: Customizing Orchard, General
Nov 3, 2015 at 1:46 PM
Hello,

Is it possible to create an instance of a content type from inside of a migration.cs?

I want to add a Query as part of my migration, so it is available when my Module is installed. Im currently trying to create it by using the contentManager and calling Create
_contentManager.Create("Query");
This is causing an System.Reflection.TargetInvocationException to be thrown.

I've looked at the following links and it does seem like it should be possible.
http://henry-chong.com/orchard-cms-how-to-create-content-in-your-module-migrations-cs
http://orchardpros.net/tickets/1248
http://orchardpros.net/tickets/4662

Does anyone have some advice?