Skip to content

Instantly share code, notes, and snippets.

@xivSolutions
Created March 5, 2014 01:33
Show Gist options
  • Save xivSolutions/9359513 to your computer and use it in GitHub Desktop.
Save xivSolutions/9359513 to your computer and use it in GitHub Desktop.
Overriding Roles and adding JsonIgnore Attribute
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