Closed lbargaoanu closed 5 years ago
Yikes.
@lbargaoanu hey! it took some time for me to find the right way to call AssertConfigurationIsValid()
and then I found out that this information was deleted from README file. I partially agree with the thought about production code but maybe just add something like this would be a better option instead of completely deleting this information:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IMapper autoMapper)
{
if (env.IsDevelopment())
autoMapper.ConfigurationProvider.AssertConfigurationIsValid();
}
But why not simply write that in a unit test?
@lbargaoanu yep, that makes sense. I was switching from static calls to di and was not sure how to make validation using di approach. This question from stackoverflow leads to a deleted section in README, so my point is that the deleted section was actually helpful in some way.
If you want to add the section back, beginning with the unit test thing, I guess that would be ok :)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Doesn't this just encourage people to call
AssertConfigurationIsValid
in production code?