I would like to be able to expose a list of users using WebAPI 2. However since I am using the new Asp.Net Authentication framework in MVC5, I can't seem to find a way to only mark specific fields as DataMembers
.
Heres what I have:
[DataContract]
public class ApplicationUser : IdentityUser {
public Nullable<DateTime> birthday { get; set; }
[DataMember]
public int tolerance { get; set; }
[DataMember]
public string twitter { get; set; }
}
However, that doesn't seem to work because IdentityUser
doesn't have the [DataContract]
attribute. I've tried creating a custom IdentityUser
, but I haven't been able to build after creating a custom copy of IdentityUser
.
Any tips or work arounds here? I'd prefer not to have to create a ViewModel, unless that's the current best practice.