Note that there are some explanatory texts on larger screens.

plurals
  1. POBreezeJs DataModal using EF as a design tool
    text
    copied!<p>I am using resource at <a href="http://www.breezejs.com/documentation/ef-design-tool" rel="nofollow">EF as Design tool</a> resource in my project. I have three different project in my solution.</p> <p>DTO - Has DbContext and DTO object and method to return metadata as describe in the example.</p> <p>Service - Has WebApi method and called getmetaData from DTO project and return string as -</p> <pre><code>[BreezeController] public class PersonController : ApiController { [HttpGet] public string MetaData() { return new LifeAudit_DTO.DtoMetaData().MetaData(); } } </code></pre> <p>3. Third project as WebApi project(Using vs2013) has routing information and refernce service library and this is my main interface(UI) project.</p> <ol> <li>I am using EF6 and latest Breeze from Nuget Project.</li> <li><p>I am setting Database init as null, following is my Datacontext code -</p> <pre><code>internal class LifeAuditDbContext : DbContext { static LifeAuditDbContext() { Database.SetInitializer&lt;LifeAuditDbContext&gt;(null); } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Configurations.Add(new PersonDtoConfiguration()); } public DbSet&lt;Person&gt; Person { get; set; } } </code></pre></li> <li><p>On calling service I got following error -</p> <p>{ $id: "1", $type: "System.Web.Http.HttpError, System.Web.Http", Message: "An error has occurred.", ExceptionMessage: "An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.", ExceptionType: "System.Data.Entity.Core.ProviderIncompatibleException", StackTrace: " at System.Web.Http.ApiController.d_<em>1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter<code>1.GetResult() at System.Web.Http.Dispatcher.HttpControllerDispatcher.&lt;SendAsync&gt;d__0.MoveNext()", InnerException: { $id: "2", $type: "System.Web.Http.HttpError, System.Web.Http", Message: "An error has occurred.", ExceptionMessage: "The provider did not return a ProviderManifestToken string.", ExceptionType: "System.Data.Entity.Core.ProviderIncompatibleException", StackTrace: " at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)", InnerException: { $id: "3", $type: "System.Web.Http.HttpError, System.Web.Http", Message: "An error has occurred.", ExceptionMessage: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)", ExceptionType: "System.Data.SqlClient.SqlException", StackTrace: " at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action</code>1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal&amp; connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource<code>1 retry, DbConnectionOptions userOptions, DbConnectionInternal&amp; connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource</code>1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&amp; connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource<code>1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource</code>1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource<code>1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource</code>1 retry) at System.Data.SqlClient.SqlConnection.Open() at System.Data.Entity.SqlServer.SqlProviderServices.&lt;>c</em>_DisplayClass2f.b_<em>2d() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.&lt;>c</em>_DisplayClass1.b__0() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func<code>1 operation) at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation) at System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action</code>1 act) at System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act) at System.Data.Entity.SqlServer.SqlProviderServices.GetDbProviderManifestToken(DbConnection connection) at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)" } } }</p></li> </ol> <p>It looks like it try to use connection for EF, but I am passing null.</p> <p>Any help will be greatly appreciated.</p> <p>Thanks, Daljit</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload