Код: Выделить всё
public IModelBinder GetBinder(ModelBinderProviderContext context)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}
if (context.Metadata.ModelType == typeof(BaseGetAllRequest) || context.Metadata.ModelType.IsSubclassOf(typeof(BaseGetAllRequest)))
{
return new BinderTypeModelBinder(typeof(SearchFiltersBinder));
}
return null;
}
Код: Выделить всё
public IModelBinder GetBinder(ModelBinderProviderContext context) => context == null
? throw new ArgumentNullException(nameof(context))
: context.Metadata.ModelType == typeof(BaseGetAllRequest) || context.Metadata.ModelType.IsSubclassOf(typeof(BaseGetAllRequest))
? new BinderTypeModelBinder(typeof(SearchFiltersBinder))
: (IModelBinder)null;
Подробнее здесь: https://stackoverflow.com/questions/761 ... itorconfig