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
/// <summary>/// Represents a single-iteration BLAKE2d hash./// </summary>/// <typeparam name="TUnderlyingType">/// The point is to associate the hash with a specific underlying type (normally a domain-specific value object), for documentation purposes, and also to prevent comparing hashes of different underlying types./// </typeparam>[ValueObject<string>]publicreadonlypartialstructHash<TUnderlyingType>{/// <summary>/// Hashes the provided string with BLAKE2d and returns a <see cref="Hash"/> instance that represents it./// </summary>publicstaticHash<TUnderlyingType>Of(TUnderlyingTypeinput){byte[]inputBytes=Encoding.UTF8.GetBytes(input);varhash=newbyte[64];BLAKE2b.ComputeHash(hash,inputBytes);returnFrom(Convert.ToBase64String(hash));}}
And realized that Vogen fails to generate code for this declaration. I see no reason why it shouldn't be able to.
The point of the generic argument, in this particular case, is to associate the hash with a specific underlying type (normally a domain-specific value object), for documentation purposes, and also to prevent comparing hashes of different underlying types.
What I want to be able to do is something like this:
[ValueObject<string>]publicreadonlypartialstructSessionKey;// This being a Vogen type is irrelevant here// Usage:Hash<SessionKey> sessionKeyHash = ...;
Please make it so that the source generator just does its thing regardless of whether or not the type has generic parameters. It would enable patterns like this one. I'd appreciate it.
The text was updated successfully, but these errors were encountered:
Describe the feature
I wanted to do this:
And realized that Vogen fails to generate code for this declaration. I see no reason why it shouldn't be able to.
The point of the generic argument, in this particular case, is to associate the hash with a specific underlying type (normally a domain-specific value object), for documentation purposes, and also to prevent comparing hashes of different underlying types.
What I want to be able to do is something like this:
Please make it so that the source generator just does its thing regardless of whether or not the type has generic parameters. It would enable patterns like this one. I'd appreciate it.
The text was updated successfully, but these errors were encountered: