You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom classes that extend a resource with a specified strongly-typed xp require the xp to be assigned in the constructor to enforce the strongly-typed xp. Currently no extended resource class adheres to this, allowing any xp to be used in code.
Prior to making the change to each class, we will need to validate that we don't introduce any data corruption to existing usages of the extended resource class or any instance of the base resource class.
public class MyUser : User<MyUserXp> (
public MyUser() {
xp = new MyUserXp();
}
)
public class MyUserXp
{
public string Gender { get; set; }
}
var user = new MyUser();
user.xp.Gender = "male"; // strongly typed!
The text was updated successfully, but these errors were encountered:
Custom classes that extend a resource with a specified strongly-typed xp require the xp to be assigned in the constructor to enforce the strongly-typed xp. Currently no extended resource class adheres to this, allowing any xp to be used in code.
Prior to making the change to each class, we will need to validate that we don't introduce any data corruption to existing usages of the extended resource class or any instance of the base resource class.
The example provided in ordercloud-dotnet-sdk: Strongly Typed xp:
The text was updated successfully, but these errors were encountered: