Information générale
Catégorie:
The Mere Mortals .NET Framework
Titre:
Help with Connection string for Entity Framework project
Hi:
SORRY for the TITLE!! I realised later that the connection string is good as the Query is returning 3 records as expected.
**************
I am starting on MM .net for 2010.
Just created the EF project and then the test project using VS2010 build in Testing tool.
Getting the following message when running the test method "GetOrderDetail":
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object.
Source=OakLeaf.MM2010.Framework
StackTrace:
at OakLeaf.MM.Main.mmAppBase.get_DatabaseMgr()
at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject(String databaseKey, Boolean localDataAccessObject)
at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject(String databaseKey)
at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject()
at OakLeaf.MM.Main.Business.mmBusinessObjectHelperEF.GetEntityList[T,EntityType](IQueryable`1 objectQuery, MergeOption mergeOption, Boolean isSecondaryList, mmBusinessObjectGeneric`1 businessObject)
at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList[T](IQueryable`1 objectQuery, MergeOption mergeOption, Boolean isSecondaryList)
at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList[T](IQueryable`1 objectQuery, MergeOption mergeOption)
at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList(IQueryable`1 objectQuery)
at ACME.OrderSystem.BusinessEF.OrderDetail.GetOrderDetail(Nullable`1 orderID) in C:\mm.netJumpStart\Order System BO EF\OrderDetail\OrderDetail.Partial.cs:line 48
at TestProject1.UnitTest1.TestGetOrderDetailByOrderID() in c:\mm.netJumpStart\TestProject1\UnitTest1.cs:line 68
InnerException:
The offending line of code is :
orderDetailList = this.GetEntityList(query);
The SQL Query is returning 3 rows as expected but somewhere these rows are not getting converted to the Order Detail Entity object.
Please help!!!
Navneet
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement