I am getting an exception when creating an entity with a single int PK and a PrefetchPath in the constructor... the natch is that the PK value in this case does not exist in the database. I figured I would just get an 'IsNew = true' entity tho.
My exception is a {"Key cannot be null.\r\nParameter name: key"} and my StackTrace is...
LLBL v2.5 Self Servicing
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.set_Item(Object key, Object value)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.DetermineDifferentValuesForParameterizedPPath(IEntityCollection rootEntities, IPrefetchPath prefetchPath, IPrefetchPathElement currentElement, Int32& amountRootEntitiesUsable)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.FetchPrefetchPath(IEntityCollection rootEntities, IPredicate filter, IRelationCollection relations, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath prefetchPath, ITransaction containingTransaction, Boolean forceParameterizedPPath)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformFetchEntityAction(IEntity entityToFetch, ITransaction containingTransaction, IPredicateExpression selectFilter, IPrefetchPath prefetchPathToUse, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.FetchExisting(IEntity entityToFetch, ITransaction containingTransaction, IPrefetchPath prefetchPathToUse, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields)
at IPSND.DAL.EntityClasses.GameEntity.Fetch(Int32 ipdbid, IPrefetchPath prefetchPathToUse, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields) in C:\Documents and Settings\jess\My Documents\Visual Studio 2005\Projects\IPSND.DAL\EntityClasses\GameEntity.cs:line 1625
at IPSND.DAL.EntityClasses.GameEntity.InitClassFetch(Int32 ipdbid, IValidator validator, IPrefetchPath prefetchPathToUse) in C:\Documents and Settings\jess\My Documents\Visual Studio 2005\Projects\IPSND.DAL\EntityClasses\GameEntity.cs:line 1395
at IPSND.DAL.EntityClasses.GameEntity..ctor(Int32 ipdbid, IPrefetchPath prefetchPathToUse) in C:\Documents and Settings\jess\My Documents\Visual Studio 2005\Projects\IPSND.DAL\EntityClasses\GameEntity.cs:line 134
at GameControl.SetGame(Int32 id) in c:\Documents and Settings\jess\My Documents\Visual Studio 2005\WebSites\IPSD\Controls\GameControl.ascx.cs:line 57
at View.Page_Load(Object sender, EventArgs e) in c:\Documents and Settings\jess\My Documents\Visual Studio 2005\WebSites\IPSD\View.aspx.cs:line 29
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The more interesting part is that I have about 7 items in my prefetch path. I can narrow it down to one specific path that relates the root entity to the path destination... this is a simple Many to 1 from the entity table
Root Entity is Game
PrefetchPathManufacturer is used
ManufacturerId is in the game table
As I mentioned at the top, the real issue seems to be only when the PK int I supply in the constructor does not exist for the root entity. I don't think this should be causing an exception tho... should it?