billbogaiv / hybrid-model-binding

Provides the ability to bind models using both ModelBinder and ValueProvider in ASP.NET Core.
MIT License
104 stars 19 forks source link

Code cleanup #60

Open Misiu opened 2 years ago

Misiu commented 2 years ago

some cleanup that was suggested by Resharper.

Things to consider (probably in the next PR).

Should I replace

var hasBindingAttribute = parameterModel.Attributes
    .Any(x => typeof(IBindingSourceMetadata).IsAssignableFrom(x.GetType()));

with

var hasBindingAttribute = parameterModel.Attributes
    .Any(x => x is IBindingSourceMetadata);

and other similar places? Also, VS2022 is suggesting many improvements, especially with LINQ. It would be easier to do such fixes if we had some tests. But maybe we can figure something out :)