Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "bilalhaidar"

Ah great. So I can authenticate my users through the framework WebApi Controllers? So I wont re-create any code, just use the existing?

Hi Ismail,

Before trying your solution, I provided a -ConnectionStringName "Default" and that worked well.

I then also tried your solution and it works.

But why would sometimes (before configuring the Web as startup) why would EF make use of a default connection string pointing to .\SQLExpress?

Thanks

Hi, I am planning to develop a simple app in Xamarin. I need to connect to the same database as my web app. Also, I want to authenticate my users against the same DB using same AppServices, etc.

Is this possible? Any helpful examples or documentation on this topic please?

Hi, I read the documentation on OU. What are possible uses of this feature? Can you please illustrate with some examples?

Thanks

Ah, that's the main reason you think? Why is that.

Hi Jeff, Great news! I followed the steps above and also on Step4 deleted all existing files and everything worked fine and smooth.

Now I have the following branches: 1- Dev 2- Master 3- Framework

Same branches on the server.

The Framework branch is now upgraded to v3.3.0.

Now, my work basically revolves around Dev. I will check out the Dev branch on the second machine to get all changes there also.

During the merge process I had only a few changes. It seems any additions or subtractions are dealt with automatically. Only conflicts on the same line need intervention from me. All of my changes were preserved when I merged from Framework to Dev.

That was a lovely day learning Git that fast and applying it. I will be writing a small blog post on the steps involved in detail so that I dont forget them for next time and even others might find it helpful also to be able to upgrade to the latest releases.

Many thanks Jeff and Ismail.

Hi Jeff,

Yes, I downloaded a Zip File with the same version I was using. Pushed it to Framework-Master on origin, is this correct?

The rest of "will do steps" are ok?

Thanks

Hi Jeff,

Thanks for the hints.

So now, I am using VS Git with online VS repository. I appreciate if you can be a bit patient and follow up with me on this process.

  1. Downloaded a fresh copy of the aspnetzero 2 releases before.
  2. Check-in the code to online repo
  3. Checked out the master into "Framework" branch
  4. Pushed the "Framework" branch to the online repo. >> Now I have 2 branches online and 2 branches locally <<
  5. I checked out a new branch called "Dev"
  6. I added all my files and folders (That I have already worked on previously) while working on "Dev" branch

Now, I will work on the following steps:

  1. Push Dev to server so that I can track Dev online (I need to open the same solution from another PC, so I need Dev to be part of online repo)
  2. Check out local "Framework" branch
  3. Download latest release of aspnetzero
  4. Override all files in "File Explorer" while "Framework" branch is checked out
  5. Push local Framework to server Framework to update server branch
  6. Check out to local "Dev" branch
  7. Merge from local "Framework" to local "Dev" (git merge)
  8. Go to VS to check changes and see how to resolve conflicts
  9. Upgrade nugets & compile
  10. Run app and make sure all is working fine

Is the plan ok so far?

One more thing, do I need to run Update-Database when I upgrade to the latest release? Or no need?

Finally, if I want to reflect all these changes to local branch master, I merge into master from local dev?

Many thanks

Hi, I downloaded the latest release. I added all my changes from existing solution files + entities into the EntityFramework.

Then, I hit Update-Database, I get an exception as shown below.

The weird thing is that, the Default connection string points to localhost server and not to .\SqlExpress, how come Update-Database (While selecting .EntityFramework project) doesn't read the actual connectionstring from .Web?

Also, when I try something like this:

PM> Update-Database -Verbose -ConnectionStringName "Default"

I receive:

No connection string named 'Default' could be found in the application config file.
PM> Update-Database -Verbose
Using StartUp project 'Drc.OnlineSystems.EntityFramework'.
Using NuGet project 'Drc.OnlineSystems.EntityFramework'.
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Target database is: 'Default' (DataSource: .\SQLEXPRESS, Provider: System.Data.SqlClient, Origin: Convention).
System.Data.SqlClient.SqlException (0x80131904): 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)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
   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& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
   at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass33.<UsingConnection>b__32()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<>c__DisplayClass1.<Execute>b__0()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation)
   at System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action`1 act)
   at System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act)
   at System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable`1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript)
   at System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
   at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
   at System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()
   at System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection)
   at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
   at System.Data.Entity.Migrations.Infrastructure.MigratorBase.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
   at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
   at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(String targetMigration)
   at System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.Run()
   at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
   at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
   at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
   at System.Data.Entity.Migrations.Design.ToolingFacade.Update(String targetMigration, Boolean force)
   at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
   at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
ClientConnectionId:00000000-0000-0000-0000-000000000000
Error Number:-1,State:0,Class:20
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)

That is possible! I will check it out.

If I want to make use of UserAppService in my Blog module, i can just use either property or constructor injector for IUserAppService and then I will be able to use that?

Thanks

Showing 441 to 450 of 635 entries