All Projects → vincechan → PostgreSQL.AspNet.Identity.EntityFramework

vincechan / PostgreSQL.AspNet.Identity.EntityFramework

Licence: MIT license
ASP.NET Identity 2.0 Storage Provider using PostgreSQL EntityFramework

Programming Languages

C#
18002 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to PostgreSQL.AspNet.Identity.EntityFramework

Decision
Simple Decision System
Stars: ✭ 50 (+92.31%)
Mutual labels:  entity-framework, asp-net-mvc
ReaLocate
ASP.NET MVC 5 Real Estate Application
Stars: ✭ 18 (-30.77%)
Mutual labels:  entity-framework, asp-net-mvc
BlipBinding
ASP.NET MVC case study solution for PluralSight Guides. Demonstrates how to use default MVC model binding with hierarchical form data.
Stars: ✭ 29 (+11.54%)
Mutual labels:  entity-framework, asp-net-mvc
Aspnetmvcactivedirectoryowin
ASP.Net MVC with Active Directory Authentication using Owin Middleware
Stars: ✭ 44 (+69.23%)
Mutual labels:  entity-framework, asp-net-mvc
Clinicmanagement
Clinic management project using Asp.net mvc5
Stars: ✭ 74 (+184.62%)
Mutual labels:  entity-framework, asp-net-mvc
Efcoresecondlevelcacheinterceptor
EF Core Second Level Cache Interceptor
Stars: ✭ 227 (+773.08%)
Mutual labels:  entity-framework
EntityFrameworkCore.AutoFixture
A library aimed to minimize the boilerplate required to unit-test Entity Framework Core code using AutoFixture and in-memory providers.
Stars: ✭ 31 (+19.23%)
Mutual labels:  entity-framework
Tracker Enabled Dbcontext
Tracker-enabled DbContext offers you to implement full auditing in your database
Stars: ✭ 210 (+707.69%)
Mutual labels:  entity-framework
Onion Architecture Asp.net Core
WhiteApp API solution template which is built on Onion Architecture with all essential feature using .NET 5!
Stars: ✭ 196 (+653.85%)
Mutual labels:  entity-framework
LinqBuilder
LinqBuilder is an advanced implementation of the specification pattern specifically targeting LINQ query generation.
Stars: ✭ 34 (+30.77%)
Mutual labels:  entity-framework
database-migrations-dotnet
A code example showing 5 ways to manage database schema in .NET
Stars: ✭ 44 (+69.23%)
Mutual labels:  entity-framework
Blazor-CRUD
Simple CRUD application using C#/Blazor
Stars: ✭ 25 (-3.85%)
Mutual labels:  entity-framework
Entitas Cpp
Entitas++ is a fast Entity Component System (ECS) C++11 port of Entitas C#
Stars: ✭ 229 (+780.77%)
Mutual labels:  entity-framework
Multitenancy-Microservice-FederatedIdentity-Example
Multitenancy Federated Identity Example ASP.NET MVC C#
Stars: ✭ 33 (+26.92%)
Mutual labels:  asp-net-mvc
Entityframework Extensions
Entity Framework Bulk Operations | Improve Entity Framework performance with Bulk SaveChanges, Insert, update, delete and merge for SQL Server, SQL Azure, SQL Compact, MySQL and SQLite.
Stars: ✭ 215 (+726.92%)
Mutual labels:  entity-framework
Templates
CodeSmith Generator Templates
Stars: ✭ 52 (+100%)
Mutual labels:  entity-framework
Urf.net
Unit of Work & Repositories Framework - .NET 4.x
Stars: ✭ 202 (+676.92%)
Mutual labels:  entity-framework
typed-ecstasy
An entity component system for TypeScript (and JavaScript), based on ashley
Stars: ✭ 25 (-3.85%)
Mutual labels:  entity-framework
pineblog
A light-weight blogging engine written in ASP.NET Core MVC Razor Pages, using Entity Framework Core or MongoDb.
Stars: ✭ 60 (+130.77%)
Mutual labels:  entity-framework
SpaceWar-ECS
A space war game made with ECS and JobSystem in Unity.
Stars: ✭ 26 (+0%)
Mutual labels:  entity-framework

PostgreSQL.AspNet.Identity.EntityFramework

ASP.NET Identity 2.0 provider that use Entity Framework for PostgreSQL.

How to use in a ASP.NET MVC5 template project

1. Set up Entity Framework for PostgreSQL

  1. Install the Npgsql.EntityFramework nuget package
  2. Update the web.config
<entityFramework>
  <defaultConnectionFactory type="Npgsql.NpgsqlFactory, Npgsql" />
  <providers>
    <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql.EntityFramework" />
  </providers>
</entityFramework>

<system.data>
  <DbProviderFactories>
    <add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql" type="Npgsql.NpgsqlFactory, Npgsql" />
  </DbProviderFactories>
</system.data>  
  1. Update the ConnectionString
<connectionStrings>
  <add name="DefaultConnection" connectionString="Server=localhost;Database=[your_db_name];User Id=[your_user];Password=[your_password];SearchPath=public;" providerName="Npgsql" />
</connectionStrings>

You do not have to use "DefaultConnection" as the name. If you use a different name, just specify the name in the nameOrConnectionString parameter in the DbConext constructor.

Specify SearchPath in the connection string to specify the schema for the Identity tables. By default, it will use public.

2. Update the project to use PostgreSQL.AspNet.Idnetity.EntityFramework

Once you have correctly setup the PostgreSQL EntityFramework, using PostgreSQL.AspNet.Identity.Framework is straight forward.

  1. Add the PostgreSQL.AspNet.Identity.EntityFramework project as a reference
  2. Remove the Microsoft.AspNet.Identity.EntityFramework nuget package and replace the "using Microsoft.AspNet.Identity.EntityFramework" statements with "using PostgreSQL.AspNet.Identity.EntityFramework" (it's in IdentityModel.cs and IdentityConfig.cs in the default mvc5 project template)

3. Use without Migration

The default database initalizer is CreateDatabaseIfNotExists. It will automatically create the database if one does not exist and it will also enable database migration. To turnoff off migration

  1. Run the PostgreSQLIdentity.sql script to create the identity tables in your postgreSQL database. We have to do this since the identity tables will not be created automatically.
  2. Set the database initalizer to NullDatabaseInitializer to turn off migration.
// put this in the project startup 
Database.SetInitializer<ApplicationDbContext>(new NullDatabaseInitializer<ApplicationDbContext>());

Demo Project

An ASP.NET MVC5 template project is included to show it in action. To run the demo project, update the web.config DefaultConnection connection string.

Note. Specify a database name that does not exist to have it create the database automatically for you. Alterntively if you wish to turn off migration, follow step 3 above.

References

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].