Hi All
I'm trying to work through the LLBLGen pro documentation step by step and get
I get ArgumentOutOfRangeException when calling PrefetchPath.Add (using the self-service classes)
Using self service general scenario, vs.net 2003
+ C# templates for SqlServer
I have the following two tables in my sql database:
BusinessGroup
int, Id (PK)
int, BusinessStreamId (fk)
string, Name
BusinessStream
int, Id (pk)
string, Name
This is the code I'm using: copied from "Using the generated code -> SelfServicing -> Prefetch paths" in the LLBLGen pro documentation
BusinessStreamDTO[] streamsDTO;
BusinessStreamCollection streams = new BusinessStreamCollection();
IPrefetchPath prefetchPath = new PrefetchPath((int)EntityType.BusinessStreamEntity);
prefetchPath.Add(BusinessStreamEntity.PrefetchPathBusinessGroup);
streams.GetMulti(null,prefetchPath);
streamsDTO = StreamsDTOFactory.CreateBusinessStreamDTOs(streams);
return streamsDTO;
This is the error message I get:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Index was out of range. Must be non-negative and less than the size of the collection.
at System.Collections.CollectionBase.System.Collections.IList.set_Item(Int32 index, Object value)
at System.Collections.CollectionBase.System.Collections.IList.set_Item(Int32 index, Object value)
at SD.LLBLGen.Pro.ORMSupportClasses.PrefetchPath.Add(IPrefetchPathElement elementToAdd, Int32 maxAmountOfItemsToReturn, IPredicateExpression additionalFilter, IRelationCollection additionalFilterRelations, ISortExpression additionalSorter)
I've tried variations of the code, and even tried adding in a sort object as well... I still get the same error.
Any advise/feedback ideas on why I am getting this error will be greatly appreciated.
regards
Alan