MapsterMapper / Mapster

A fast, fun and stimulating object to object Mapper
MIT License
4.3k stars 328 forks source link

Add options to Mapster.Tool to generate files with #nullable directives #530

Closed kescherCode closed 1 year ago

kescherCode commented 1 year ago

Fixes https://github.com/MapsterMapper/Mapster/issues/337 for Mapster.Tool

This allows to add "--nullableDirective" to the options already set within a given csproj file to add an #nullable enable, in order to suppress CS8669 warnings that are raised specifically due to generated source files having to add this directive even if a project has Nullable enabled.

andrerav commented 1 year ago

Hi @kescherCode, thank you for contributing this, this has been requested a few times now so I think you will make a lot of people happy :) Would you consider adding a short form option as well? The obvious choice (-n) is already taken, but perhaps -N will work?

andrerav commented 1 year ago

Awesome, thanks!