using Microsoft.AspNetCore.Mvc.ModelBinding; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace GreenTree.Strohrmann.ERP.Web.Models { public class CustomerModelBinder : IModelBinder { public Task BindModelAsync(ModelBindingContext bindingContext) { if (bindingContext == null) { throw new ArgumentNullException(nameof(bindingContext)); } // Try to fetch the value of the argument by name var valueProviderResult = bindingContext.ValueProvider.GetValue("Lastname"); return Task.CompletedTask; } } }