I wanna create an article as content part for a content type in migration of my module, but when I added the article, code show me an error. here's the code:
public int UpdateFrom3() {
ContentDefinitionManager.AlterPartDefinition(typeof(TourPart).Name, cfg => cfg.Attachable());
ContentDefinitionService.AddPartToType("Article" + "Part", "Tour");
ContentDefinitionManager.AlterPartDefinition(
"Article" + "Part",
b => b
.WithField("Name", f => f
.OfType("InputField").WithDisplayName("Name"))
.WithField("ImageField", f => f
.OfType("MediaLibraryPickerField").WithDisplayName("Images")
.WithSetting("MediaLibraryPickerField.Hint", "Images everywhere!").WithSetting("MediaLibraryPickerFieldSettings.Required", "False")
.WithSetting("MediaLibraryPickerFieldSettings.Multiple", "True"))
.WithField("ShortDesc", f => f
.OfType("TextField").WithDisplayName("Short Description")
.WithSetting("TextFieldSettings.Flavor", "Html"))
.WithField("LongDesc", f => f
.OfType("TextField").WithDisplayName("Long Description")
.WithSetting("TextFieldSettings.Flavor", "Html")));
return 4;
}
at the ContentDefinitionService.AddPartToType("Article" + "Part", "Tour");
section, code show me this:
An object reference is required for non-static field
what can I do to my code accept this?