-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support F# Discriminated Unions #66
Comments
Maybe I don't understand the serialization mechanism or I cannot find a way to transform property value to Gremlinq supported type before serialization? |
Not sure what you are proposing I'm afraid |
Let's have a look at [Serializable, StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto, Size=1), Struct,
public struct DomainID<t> : IEquatable<DomainID<t>>, IStructuralEquatable, IComparable<DomainID<t>>, IComparable, IStructuralComparable
{
internal Guid item;
[CompilationMapping(SourceConstructFlags.UnionCase, 0)]
internal static DomainID<t> NewDomainID(Guid item) =>
new DomainID<t>(item);
[CompilerGenerated, DebuggerNonUserCode]
internal DomainID(Guid item)
{
this.item = item;
}
[CompilationMapping(SourceConstructFlags.Field, 0, 0), CompilerGenerated, DebuggerNonUserCode]
internal Guid Item => this.item;
... As you can see it is a wrapper struct that holds a single value and has phantom generic parameter to distinguish Id for different entities. |
How can Gremlinq be extended to support such a scenario? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
You can see something similar here for TimeSpans-to-double and vice versa conversion. None of this has been released yet though. |
This scenario is possible with the latest preview, see comment above. |
Looks good, thanks! |
@danielcweber could you point to the place where I can look at the sample now? |
Is your feature request related to a problem? Please describe.
I cannot use F# discriminated unions, in particular, single case unions as properties.
Describe the solution you'd like
Implement Gremlinq converted based on Newtonsoft's
DiscriminatedUnionConverter
Additional context
The text was updated successfully, but these errors were encountered: