Support for ASP.NET Core Identity?

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Support for ASP.NET Core Identity?

Post by RobertK » Wed 15 Mar 2017 04:34

Other than modifying the built in EFCore Template, is there any way to specify support for ASP.NET Core Identity?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Support for ASP.NET Core Identity?

Post by Shalex » Wed 15 Mar 2017 19:10

We are investigating ASP.NET Core Identity and working on its support "out of the box" by Devart EF Core providers.

The corresponding support will be implemented in the dotConnect providers, i.e. Entity Developer will not include any special templates for this feature.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Support for ASP.NET Core Identity?

Post by RobertK » Thu 16 Mar 2017 12:05

"out of the box" support for ASP.NET Core Identity, how likely and when would this feature be implemented?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Support for ASP.NET Core Identity?

Post by Shalex » Tue 21 Mar 2017 09:47

"out of the box" means the minimum steps to set up ASP.NET Core Identity for using it via dotConnect providers. The investigation is in progress. There is no any timeframe at the moment. We will notify you when the feature is implemented.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Support for ASP.NET Core Identity?

Post by RobertK » Wed 22 Mar 2017 09:59

Shalex wrote:"out of the box" means the minimum steps to set up ASP.NET Core Identity for using it via dotConnect providers. The investigation is in progress. There is no any timeframe at the moment. We will notify you when the feature is implemented.
Shalex

How do you use Entity Developer with ASP.NET Core Identity in its current state?

Our app has its own custom class models and ASP.NET Identity has its own class models
User
UserLogin
UserRole
UserClaim
RoleClaim
UserToken

Our class model reference User identity model, so now we have a problem!?
Last edited by RobertK on Wed 22 Mar 2017 10:02, edited 2 times in total.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Support for ASP.NET Core Identity?

Post by RobertK » Wed 22 Mar 2017 13:35

I worked out how to add asp.net identity support to the context code generator template.

But now the class model, every time the generator detects a predefined identity class model name, it would add code that looks something like the code shown below, in addition to this the code generator would have to remove properties that have already been defined by identity. (it might be best if devart let us configure the code generators behaviour for specific class models???)

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace MyApp.Models
{
    public partial class User : IdentityUser<long>
    {
        public DateTime? Created { get; set; }
        public DateTime? Updated { get; set; }

    }
    public partial class UserLogin : IdentityUserLogin<long>
    {
    }
    public partial class UserRole : IdentityUserRole<long>
    {
    }
    public partial class UserClaim : IdentityUserClaim<long>
    {
    }
    public partial class Role : IdentityRole<long>
    {
    }
    public partial class RoleClaim : IdentityRoleClaim<long>
    {
    }
    public partial class UserToken : IdentityUserToken<long>
    {
    }

}

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Support for ASP.NET Core Identity?

Post by Shalex » Thu 23 Mar 2017 18:22

1. You are working with PostgreSQL Server via dotConnect for PostgreSQL, aren't you?

2. The ASP.NET Core Identity support will be implemented at the provider level (via EF Code-First). The predefined PostgreSQL shema will be created by EF Code-First Migrations via dotConnect for PostgreSQL. There is no need to employ Entity Developer for this task. We will notify you when the feature is implemented.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Support for ASP.NET Core Identity?

Post by RobertK » Wed 05 Apr 2017 02:15

Shalex wrote:1. You are working with PostgreSQL Server via dotConnect for PostgreSQL, aren't you?

2. The ASP.NET Core Identity support will be implemented at the provider level (via EF Code-First). The predefined PostgreSQL shema will be created by EF Code-First Migrations via dotConnect for PostgreSQL. There is no need to employ Entity Developer for this task. We will notify you when the feature is implemented.
I am using npgsql npgsql.org would this be a problem?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Support for ASP.NET Core Identity?

Post by Shalex » Fri 07 Apr 2017 11:13

We do not provide support for Npgsql provider (please contact its vendor).

Concerning dotConnect for PostgreSQL, the next public build will include the following improvements:
* The support of EF Core models with string columns, which are defined without length limit and participate in PKs, FKs, indices, is improved
* The compatibility with ASP.NET Core Identity is improved

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Support for ASP.NET Core Identity?

Post by Shalex » Fri 26 May 2017 19:48

dotConnect for PostgreSQL 7.9 is released: viewtopic.php?f=3&t=35438.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Support for ASP.NET Core Identity?

Post by RobertK » Tue 30 May 2017 14:40

Shalex wrote:dotConnect for PostgreSQL 7.9 is released: viewtopic.php?f=3&t=35438.
I'm unable to determine how to turn on support for asp.net core identity?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Support for ASP.NET Core Identity?

Post by Shalex » Wed 31 May 2017 09:52

Simple walkthrough:

* install dotConnect for PostgreSQL v7.9 Professional Trial

* create File > New > Project > Installed > Visual C# > Web > ASP.NET Core Web Application (.NET Core), select Web Application and set Authentication: Individual User Accounts

* run command via Package Manager Console
PM> install-package Devart.Data.PostgreSql.EFCore -Source:"https://www.nuget.org/api/v2/"

* replace
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
with
options.UsePostgreSql(Configuration.GetConnectionString("DefaultConnection")));
in Startup.cs

* set your DefaultConnection for PostgreSQL in appsettings.json

* execute command via Package Manager Console
PM> update-database

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Support for ASP.NET Core Identity?

Post by RobertK » Wed 31 May 2017 11:20

Shalex wrote:Simple walkthrough:

* install dotConnect for PostgreSQL v7.9 Professional Trial

* create File > New > Project > Installed > Visual C# > Web > ASP.NET Core Web Application (.NET Core), select Web Application and set Authentication: Individual User Accounts

* run command via Package Manager Console
PM> install-package Devart.Data.PostgreSql.EFCore -Source:"https://www.nuget.org/api/v2/"

* replace
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
with
options.UsePostgreSql(Configuration.GetConnectionString("DefaultConnection")));
in Startup.cs

* set your DefaultConnection for PostgreSQL in appsettings.json

* execute command via Package Manager Console
PM> update-database
Thanks for the prompted response.

I'm slightly confused. isn't this the way you always set it up?...Even so, if you do this, Entity developer, still would not automatically add identity framework inherenance to custom tables. The software is unable to determine which is an identity framework entity vs regular entity.... Unless there's someway to tag the class model in entity developer?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Support for ASP.NET Core Identity?

Post by Shalex » Thu 01 Jun 2017 17:28

Our current roadmap for Entity Developer doesn't include any template for extending standard ASP.NET Core Identity functionality. Please submit your suggestion at https://devart.uservoice.com/forums/386 ... -developer.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Support for ASP.NET Core Identity?

Post by RobertK » Fri 02 Jun 2017 02:28

Shalex wrote:Our current roadmap for Entity Developer doesn't include any template for extending standard ASP.NET Core Identity functionality. Please submit your suggestion at https://devart.uservoice.com/forums/386 ... -developer.
What does the current ASP.NET Core Identity support include?

Post Reply