LLBLGen Pro 2
ASP.NET 2.0 with C#
Hi guys, i m using the sample code from the LLBL documentations, and made changes accordingly to the variable names, yet still i get the following error:
Argument '1': cannot convert from 'System.Collections.ArrayList' to 'System.Collections.Generic.List<SD.LLBLGen.Pro.ORMSupportClasses.IEntityPropertyProjector>'
Error 1 The best overloaded method match for 'SD.LLBLGen.Pro.ORMSupportClasses.EntityView<SBVS.EntityClasses.MHubDlpGroupEntity>. CreateProjection(System.Collections.Generic.List<SD.LLBLGen.Pro.ORMSupportClasses. IEntityPropertyProjector>, System.Data.DataTable)' has some invalid arguments
I had tried out using <List>IEntityPropertyProjector propertyProjectors = new IEntityPropertyProjector(); yet i get another error:
Error The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)
What am i actually missing?
the code i used are as below:
// C#
// fetch all managers
ManagerCollection managers = new ManagerCollection();
managers.GetMulti(null);
// now project them onto 2 new clerk entities, by just projecting the employee fields
ArrayList propertyProjectors = new ArrayList();
propertyProjectors.Add( new EntityPropertyProjector( EmployeeFields.Id, "Id" ) );
propertyProjectors.Add( new EntityPropertyProjector( EmployeeFields.Name, "Name" ) );
propertyProjectors.Add( new EntityPropertyProjector( EmployeeFields.StartDate, "StartDate" ) );
propertyProjectors.Add( new EntityPropertyProjector( EmployeeFields.WorksForDepartmentId, "WorksForDepartmentId" ) );
ClerkCollection clerks = new ClerkCollection();
EntityView managersView = managers.DefaultView;
// project data to transform all managers into clerks.
managersView.CreateProjection( propertyProjectors, clerks );
Thank you all for the help.
Best regards,
yjpan