using GreenTree.Strohrmann.ERP.Web.Models.Business; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding.Binders; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace GreenTree.Strohrmann.ERP.Web.Models { public class CustomerModelBinderProvider : IModelBinderProvider { public IModelBinder GetBinder(ModelBinderProviderContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (context.Metadata.ModelType == typeof(CustomerModel)) { return new BinderTypeModelBinder(typeof(CustomerModelBinder)); } return null; } } }