I have a content area which will have some blocks, some attributes of these blocks must be initialized with data from a SQL query, so in the controller I have something like this:
foreach (ObjectType item in MyList)
{
BlockData currentObject = new BlockData
{
BlockDataProperty1 = item.ItemProperty1,
BlockDataProperty2 = item.ItemProperty2
};
/*Dont know what to do here*/
}
What I need, is to work with currentObject
as a block, and add it to a content area I have defined in another block. I tried using
myContentArea.Add(currentObject)
but it says it can't add an object into a content area because it is expecting for an IContent
type.
How can I cast that object into an IContent
?