Joreyk ( IXLLEGACYIXL )
What does happen with nullable
public static void Write(this IYamlStream stream, string Key, ref string? value, ScalarStyle style = ScalarStyle.Any)
i have this, what does happen when value is non nullable? is it boxed?
can i somehow write an extension method for a nullable value and a non nullable value? when doing so it says that the metohd is allready defined but one method is about a boxed string and the other one isnt so isnt it different in the end?12 replies
How to work better with records
https://gist.github.com/IXLLEGACYIXL/e3c5575656de0bebf314096699e9d42c
I have this and want the modified item after breakthrough is applied, but i dont want to modify the original item
but it seems like this shouldnt be the way to work with records... can i simplify that syntax?
86 replies
✅ How to Simplify
I have this https://gist.github.com/IXLLEGACYIXL/399c51cf0341188bdc4e02a820c34ce0
I need the generictypedefinitions hash and not the "normal" hashcode of the type
now i wrote that to "override" the gethashcode to get the generic one, isnt there a simpler way to achieve that?
21 replies
Problem with Generics
https://github.com/NexStandard/NexVYaml/tree/master/VYaml.Core/Serialization
I dont know how to get further here
In the NexYamlSerializerRegistry all Serializers are registered.
Like So
, tinherit implements iCLoneable but it doesnt matter its just for having an interface
`
Now the https://github.com/NexStandard/NexVYaml/blob/master/VYaml.Core/Serialization/YamlSerializer.cs#L41 serializer calls the redirector because i dont know which path to go when i have Serialize(ICloneable) so i need to find it in the registry and now the trouble starts as i cant search it as the generic type doesnt fit here
https://github.com/NexStandard/NexVYaml/blob/master/VYaml.Core/Serialization/Resolvers/RedirectFormatter.cs#L56
because T is ICloneable which and the serialize method uses T value ( the one to serialize ) but i cant convert IYamlFormatter<TInherit> to IYamlFormatter<ICloneable> because of the covariance i guess... i have no clue actually to what i should convert it... in the formatter variable is the correct one there but its just a IYamlFormatter and not the generic one so it doesnt have the Serialize(T value, blabla)
3 replies
❔ Csharp equivalent of JPA Stored Procedure Persistence
What is something of an equivalent to the java jpa persistence in c#
https://www.baeldung.com/spring-data-jpa-stored-procedures
it calls a procedure in my MSSQL server and then it converts them to Persistent Objects.
i have not found of an equivalent in c# to call stored procedures+ converting them to objects straight away
23 replies