I am using custom model binder in web api, but my model value is null.
It is unable to get the value from ValueProvider.
Please look at my code below.
bindingContext.ValueProvider.GetValue("Report") is null
Here is my code.
public class TestReportDto
    {
        public ReportFormatType ExportFormat { get; set; }
        public string Report { get; set; }
        public Dictionary<string, object> ParameterValues { get; set; }
    }
    public enum ReportFormatType
    {
        PDF,
        XLS
    }
My Model Binder class.
public class TestModelBinder : IModelBinder
    {
        public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
        {
            var testReportDto = new TestReportDto();
            bool isSuccess = true;
            if (bindingContext.ValueProvider.GetValue("Report") != null)
            {
                testReportDto.Report = Convert.ToString(bindingContext.ValueProvider.GetValue("Report").RawValue);
            }
            else
            {
                isSuccess = false;
                bindingContext.ModelState.AddModelError("request.Report", "Report");
            }
            bindingContext.Model = testReportDto;
            return isSuccess;
        }
    }
API Code:
public async Task<string> Post([ModelBinder(typeof(TestModelBinder))]TestReportDto request)
        {
            return "Hello";
        }
 
    