This project is read-only.

Adding Model to Database

Topics: Writing modules
Oct 18, 2011 at 10:15 AM

Hi, Orchard Team.

I try to add an object of model ProductPart that has two fields: UserID and ProductID to the database.

I try to do this code and get an InvalidCastException:

using Orchard.ContentManagement;


ProductPart product = Services.ContentManager.New<ProductPart>("ProductItem");

product.UserID = x;

product.ProductID = y;




cfg => cfg




Oct 18, 2011 at 7:47 PM


Oct 19, 2011 at 12:05 AM

Oh, I've already solved the problem. It was the driver absence.