Adding a property to a document type using ContentTypeService
I'm developing a package that will depend on a specific property on the Home document type. (Assuming a document type with alias "home" exists).
So in ApplicationStarted, I have the following code to add the property:
var cs = applicationContext.Services.ContentTypeService;
var homeType= cs.GetContentType("home");
var customerContact = new PropertyType("textbox", DataTypeDatabaseType.Nvarchar, "TestAddProp");
homeType.AddPropertyType(customerContact);
cs.Save(homeType);
On that last line I get a SQL exception complaining that there is no primary key to use as a foreign key.
Do I need to somehow save the the new property type first?
Adding a property to a document type using ContentTypeService
I'm developing a package that will depend on a specific property on the Home document type. (Assuming a document type with alias "home" exists).
So in ApplicationStarted, I have the following code to add the property:
On that last line I get a SQL exception complaining that there is no primary key to use as a foreign key.
Do I need to somehow save the the new property type first?
is working on a reply...