Created
March 5, 2014 01:33
-
-
Save xivSolutions/9359513 to your computer and use it in GitHub Desktop.
Overriding Roles and adding JsonIgnore Attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApplicationUser : IdentityUser | |
{ | |
[Required] | |
public string FirstName { get; set; } | |
[Required] | |
public string LastName { get; set; } | |
[Required] | |
public string Email { get; set; } | |
// IdentityUserRole contains a reference to the user, and a role. This is where the circular reference comes from. | |
[JsonIgnore] | |
public override ICollection<IdentityUserRole> Roles { | |
get { | |
return base.Roles; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment