Thursday, 19 August 2010

LLBLGen - EntityCollection to DataTable Conversion?

public DataTable CollectionToDataTable(EntityCollectionBase collection, string TableName)
where TEntity : EntityBase, IEntity
{
List propertyProjectors =
EntityFields.ConvertToProjectors(collection.EntityFactoryToUse.CreateFields());
DataTable dt = new DataTable(TableName);
collection.DefaultView.CreateProjection(propertyProjectors, dt);
return dt;
}

Reference: http://www.llblgen.com/tinyforum/GotoMessage.aspx?MessageID=77377&ThreadID=3861

No comments:

Post a Comment