EF Core 2.0 Identity - Adding navigation properties

367
August 24, 2017, at 10:14 PM

In EF Core 2.0 Identity navigation properties are not included by default, so after upgrading, I added them. So for Many-To-Many relationship between User and Role, and One-To-Many relationship between Role and RoleClaim, I added following navigation properties:

public class User : IdentityUser
{
    [Required]
    public string Name { get; set; }
    public virtual ICollection<IdentityUserRole<string>> Roles { get; set; }
}
public class Role : IdentityRole
{
    [Required]
    public string Name { get; set; }
    public virtual ICollection<IdentityRoleClaim<string>> Claims { get; set;}
}

Surprisingly it adds an additional RoleId1 key to AspNetRoleClaims table and UserId1 to AspNetUserRoles tables and all the get queries actually use new keys instead of RoleId and UserId which are also present.

Rent Charter Buses Company
READ ALSO
mysql column type to improve select performance

mysql column type to improve select performance

I have 2 tables with the same column (table A for a kind of product, table B for another type) with 10k of rows per tables

291
Firebase PHP authentication

Firebase PHP authentication

I was looking for a reliable authentication system for my backend, my current API implementation is in PHP and MySQLI would like to integrate what Google Identity Toolkit promises, but now there is a strong suggestion by them to use Firebase Authentication

371
Entity framework adds an extra condition on where clause

Entity framework adds an extra condition on where clause

I have identified that when the following expression is executed:

260
How do I see if a string contains another string with quotes in it?

How do I see if a string contains another string with quotes in it?

I am trying to see if a large string contains this line of HTML:

39