Is there any way to remove model validation for some properties in a Model in ASP.Net MVC6.

I came across this post https://stackoverflow.com/questions/14008561/is-there-a-strongly-named-way-to-remove-modelstate-errors-in-asp-net-mvc/36359386?noredirect=1#comment60338333_36359386

which suggests using, ModelBindingHelper.ClearValidationStateForModel(Type, ModelStateDictionary, IModelMetadataProvider, string).

But I am unable to find any further help on this.

Can anyone please suggest a working example of removing a model property using ClearValidationStateForModel?

ModelBindingHelper is new to ASP.NET Core 2.0 / MVC6+

If you need to use against previous versions of .NET / ASP.NET, you can do the following per Simon_Weaver's answer on Is there a strongly-named way to remove ModelState errors:

Here's my solution - a RemoveFor() extension method on ModelState, modelled after MVC HTML helpers:

<!-- language: lang-cs -->
public static void RemoveFor<TModel>(this ModelStateDictionary modelState, 
                                     Expression<Func<TModel, object>> expression)
{
    string expressionText = ExpressionHelper.GetExpressionText(expression);

    foreach (var ms in modelState.ToArray())
    {
        if (ms.Key.StartsWith(expressionText + "."))
        {
            modelState.Remove(ms);
        }
    }
}

And here's how it's used:

<!-- language: lang-cs -->
if (model.CheckoutModel.ShipToBillingAddress == true) 
{
    // COPY BILLING ADDRESS --> SHIPPING ADDRESS
    ShoppingCart.ShippingAddress = ShoppingCart.BillingAddress;

    // REMOVE MODELSTATE ERRORS FOR SHIPPING ADDRESS
    ModelState.RemoveFor<SinglePageStoreModel>(x => x.CheckoutModel.ShippingAddress);
}

if (ModelState.IsValid) 
{
     // should get here now provided billing address is valid
}