After having hard time making this work with some unusual error such as "Key 'iRelyReportsEntities_Example' object reference.....' when performing query, we eliminate the error by just doing the relationship via Fluent API.
I noticed that the problem occurs in the client side unlike the first one w/c occurs in the server side..
at IdeaBlade.EntityModel.EntityProperty.GetValueRaw(IStructuralObject so)
at IdeaBlade.EntityModel.EntityAspect.GetValueRaw(DataEntityProperty property, EntityVersion version)
at IdeaBlade.EntityModel.EntityAspect.<GetValuesRaw>b__17(DataEntityProperty p)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at IdeaBlade.EntityModel.EntityAspect.GetValuesRaw(IEnumerable`1 properties)
at IdeaBlade.EntityModel.EntityAspect.get_EntityKey()
at IdeaBlade.EntityModel.EntityGroup.LoadEntity(EntityAspect sourceAspect, MergeStrategy mergeStrategy, Boolean& rowUpdated)
at IdeaBlade.EntityModel.EntityMerger.MergeEntityCore(EntityAspect sourceAspect, EntityGroup targetEntityGroup)
at IdeaBlade.EntityModel.EntityMerger.MergeEntity(EntityAspect sourceAspect, EntityGroup targetEntityGroup, NavigationContext context)
at IdeaBlade.EntityModel.EntityMerger.<>c__DisplayClass9.<MergeEntities>b__8(EntityAspect sourceAspect)
at System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at IdeaBlade.Core.EnumerableFns.ForEach[T](IEnumerable`1 items, Action`1 action)
at IdeaBlade.EntityModel.DataBlockFns.MakeResultList(Type type, IEnumerable items, Boolean isOrdered)
at IdeaBlade.EntityModel.EntityQueryResult.UpdateDataSet(EntitiesDataBlock block, NavigationContext context)
at IdeaBlade.EntityModel.EntitiesDataBlock.Resolve(EntityQueryResult helper)
at IdeaBlade.EntityModel.EntityQueryResultCollection..ctor(DataQueryResultCollection dqResults, EntityManager entityManager, MergeStrategy mergeStrategy)
at IdeaBlade.EntityModel.EntityManager.MergeAndReturnUsingCache(IEntityFinder finder, DataQueryResultCollection dqResults)
at IdeaBlade.EntityModel.EntityManager.ProcessFetchedData(DataQueryResultCollection dqResults, IEntityFinder finder)
at IdeaBlade.EntityModel.EntityManager.ExecuteFetch(IEntityFinder finder)
at IdeaBlade.EntityModel.EntityQueryFinder.Execute()
at IdeaBlade.EntityModel.EntityManager.ExecuteQueryCore(IEntityQuery query, Boolean isAsync)
at IdeaBlade.EntityModel.EntityManager.ExecuteQuery[T](IEntityQuery`1 query)
at IdeaBlade.EntityModel.EntityQueryExtensions.Execute[T](IEntityQuery`1 query)
at IdeaBlade.EntityModel.EntityQuery`1.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at TestProject.Program.Main(String[] args) in D:\NEW TFS 2\iRely Suite\Development Work\iRely Suite Report\TestProject\Program.cs:line 70
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
I just wonder why it's so complicated using the Devforce Code First over to Database First?
It's just frustrating to have these errors that we didn't experience before we're on Database First.
Not to mention that there are no "user friendly message" when an error occurs.
I hope this can be improved.