Skip to content

I was working on integrating ASP.NET Identity into an existing project and realized that I couldn't find a management piece to go along with the identity piece.  I searched all the usual places, but the only luck I had was finding bits and snippets of how the whole management part was supposed to work.  I finally was able to cull all these different pieces into a working solution, complete with user and role editing, and the assignment of roles to users.

To take this solution to the next step, I created a VS 2017 template that takes the boilerplate solution I created and gives the developer the ability to rename the project, which in turn, renames the namespace and prefixes for the identity classes, managers, stores, etc. with the safe project name.  It also creates an Administrators role and admin users via seeding the database.  This can be changed (and I strongly encourage this change) so as to not put the default admin name and password live on the web.

I can't take full credit for writing this from scratch, it's just a gathering of the different methods that I found either on Stack Overflow or on other developer blogs.  I just want to help us developers to spend less time on searching for answers and make use of templates.

Here is the GitHub link to the project, which includes the source files and the actual template file in zipped format.

Let me know what you think in the comments section.

I came across this by accident.  I was having issues with queries taking forever to return results.  Turns out, that if you pass parameters into a SP and use them in more than one place in the query, it will slow down the results returned to the user.

So, here's what you do...

  • Define your parameters as usual
  • At the the very beginning of the SP, declare a variable for each parameter making sure they have the same data type.
  • Set each of the declared variables equal to the matching parameter.
  • Use the declared variables in the query where you would usually use the parameters.

You will be amazed at the speed increase.