| 12345678910111213141516171819202122232425262728 |
- 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;
- }
- }
- }
|