CSharpFunctionalExtensions icon indicating copy to clipboard operation
CSharpFunctionalExtensions copied to clipboard

Create full documentation

Open vkhorikov opened this issue 4 years ago • 4 comments

Full documentation with auto-generation from md files.

Don't forget to cover the following topics:

  • C# non-nullable reference types and Maybe
  • This comment: https://enterprisecraftsmanship.com/posts/reference-data-as-code/#comment-5327672166
  • EnunValueObject

Write a blog post recapping the main points

vkhorikov avatar Dec 26 '20 23:12 vkhorikov

I would be happy to make some effort if given a boilerplate/ setup ready. There are lots of ways of documenting in the form of markdown and simply not sure which is the one you want.

hoshinokanade avatar Mar 07 '21 14:03 hoshinokanade

Yeah, I plan to work on this in the next 1 or 2 months. Not sure about the template yet either.

vkhorikov avatar Mar 08 '21 04:03 vkhorikov

Hello!

I've been searching for a bit, and am wondering if you had a moment to post that blog post. The only documentation I can find on this class (other than the code) is:

  • https://github.com/vkhorikov/CSharpFunctionalExtensions/issues/274
  • https://github.com/vkhorikov/CSharpFunctionalExtensions/issues/314

Thanks!

My implementation of EnumValueObject I would like to use it to represent 'votes'. For example Reddit:

  • Dowvote: -1
  • Neutral: 0
  • Upvote: 1

It could even be:

  • Neutral: 0
  • Downvote: 1
  • Upvote: 2

The numbers are an int and represent an index. I saw in the code that it only allows for string.

Is there any way I can use an int instead of a string?

If not, would you be open to a PR which brought the feature over from SmartEnum

Or possibly even the best solution, allow for a dependency (or optional dependency in a separate NuGet package of SmartEnum

jeffward01 avatar Dec 29 '22 05:12 jeffward01

Is there any way I can use an int instead of a string?

Yes, the class allows to specify any type: for the Id (TId): https://github.com/vkhorikov/CSharpFunctionalExtensions/blob/master/CSharpFunctionalExtensions/ValueObject/EnumValueObject.cs#L8

vkhorikov avatar Jan 02 '23 03:01 vkhorikov