-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
When using strongly typed XP with full models, everything works as expected. However, on partial models, XP is returned as dynamic, breaking type safety.
Example
public class UserXp {
public bool HasLoggedIn { get; set; }
}
var user = new User<UserXp> { };
var userLoggedIn = user.xp.HasLoggedIn; // Strongly typed!
var partialUser = new PartialUser<UserXp> { };
var pUserLoggedIn = partialUser.xp.HasLoggedIn; // This is not strongly typed! xp comes back as dynamicThis may be tricky to support because for partials we want to send OrderCloud only the values that have changed. To do that, we need to distinguish between a property with a null/default value and a completely absent property. In any case, we should either figure out how to support this OR simply not generate types that make it look like it's supported.
Metadata
Metadata
Assignees
Labels
No labels