Vogen icon indicating copy to clipboard operation
Vogen copied to clipboard

Instance with 1 parameter

Open arteny opened this issue 1 year ago • 2 comments

Describe the feature

For the underlying type string, I often use a set of strings that need to be strongly typed. For example:

	[ValueObject(typeof(string))]
	[Instance("Users", "Users")]
	public struct TabName {}

means name and value are same, can you allow to add it specifying only one parameter for such cases like [Instance("Users")]?

arteny avatar Feb 20 '24 18:02 arteny

Hi @arteny - an interesting proposal. This looks like it might be better as an enum though. I spawned off 'Intellenum' due to the similarities between Vogen 'insances' and enums.

SteveDunn avatar Feb 21 '24 20:02 SteveDunn

Hi @arteny - an interesting proposal. This looks like it might be better as an enum though. I spawned off 'Intellenum' due to the similarities between Vogen 'insances' and enums.

ahh, ok, Inetllenum looks good for this, then just a same purposal for it (to allow 1 parameter for string instances)

arteny avatar Feb 22 '24 10:02 arteny

@arteny - how are you getting on with Intellenum? I've closed this one, but let me know if you need any help.

SteveDunn avatar Apr 24 '24 22:04 SteveDunn

@arteny - how are you getting on with Intellenum? I've closed this one, but let me know if you need any help.

Intellenum is good enough, but it miss same feature to create instances where value=name using 1 parameter. It looks more perfect and it is more misprint-resistance.

fbestfriends avatar Apr 25 '24 21:04 fbestfriends

@arteny @fbestfriends - I've created a feature request in Intellenum: https://github.com/SteveDunn/Intellenum/issues/127

SteveDunn avatar Apr 27 '24 04:04 SteveDunn