GithubHelp home page GithubHelp logo

Comments (4)

grandchamp avatar grandchamp commented on May 14, 2024

Yes, this behavior is just in SQL Server. The property TableFieldNotation on SqlConfiguration it's for this, but it's a single character, and for SQL i have to switch [ for the beggining and ] for the last position. I'll think in something to make this works.

from identity.dapper.

bagzli avatar bagzli commented on May 14, 2024

In my case what I did was I rewrote the Identity.Dapper.SqlServer dll. Because I had to change table names, I had to modify this dll, so I just wrote my own as it is a very small dll. When I did that, I simply changed lines of such as this:

GetUserLoginByLoginProviderAndProviderKeyQuery = "SELECT TOP 1 %USERFILTER% FROM %SCHEMA%.%USERTABLE%, %SCHEMA%.%USERLOGINTABLE% WHERE %SCHEMA%.%USERTABLE%.Id = %SCHEMA%.%USERLOGINTABLE%.UserId AND LoginProvider = %LOGINPROVIDER% AND ProviderKey = %PROVIDERKEY%";

To look like this

GetUserLoginByLoginProviderAndProviderKeyQuery = "SELECT TOP 1 %USERFILTER% FROM %SCHEMA%.[%USERTABLE%], %SCHEMA%.%USERLOGINTABLE% WHERE %SCHEMA%.[%USERTABLE%].Id = %SCHEMA%.%USERLOGINTABLE%.UserId AND LoginProvider = %LOGINPROVIDER% AND ProviderKey = %PROVIDERKEY%";

You could resolve it in such way for your dll too, however, I must admit it would be nice being able to set Table Names outside of your dll in some way. Maybe there is and I missed it?

from identity.dapper.

grandchamp avatar grandchamp commented on May 14, 2024

You can create a class inheriting from SqlServerConfiguration, or declare a new instance of SqlServerConfiguration and change RoleTable, UserTable, UserClaimTable, UserRoleTable and UserLoginTable properties values.

from identity.dapper.

grandchamp avatar grandchamp commented on May 14, 2024

Not really a fix, but 34f240c does it for the default tables now. If you want to change your table names on SQL Server, you can do:

.AddDapperIdentityFor(new SqlServerConfiguration
{
      RoleTable = "[My Table IdentityRole]",
      UserTable = "[User]";
      UserClaimTable = "[MyIdentityUserClaim]";
      UserRoleTable = "[MyIdentityUserRole]";
      UserLoginTable = "[MyIdentityLogin]";
})

from identity.dapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.