I use telerik Domain Model for ASP.NET MVC 5. When I use context at Unit test project, all thing works perfectly. but when I use it at MVC Controllers I got this Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString connectionString, PropertySet driverProps, ConnectionPoolType poolType, LogEventStore pes)
at OpenAccessRuntime.Relational.sql.SqlDriver.InitializeFor(ConnectionString connectionString, Boolean noConnect, PropertySet props, DBDriver& driver, Connection& conn, ConnectionPoolType poolType)
at OpenAccessRuntime.Relational.RelationalStorageManagerFactory..ctor(StorageManagerFactoryBuilder b)
at OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL()
thanks
I found this solution after many trial and error
I must query the database after Initialize or I will get Null reference error. If anyone has better solution or explaination, I will be happy to know it. thanks