I have a null error for my runtime DTO object:
I did not understand, because the column is NULL:
[DataContract] public class SearchParametersCompanyDTO { public SearchParametersCompanyDTO(); [DataMember] public CompanyColumnsEnumDTO? Column { get; set; } [DataMember] public int PageIndex { get; set; } [DataMember] public int PageSize { get; set; } [DataMember] public string Term { get; set; } } [DataContract] public enum CompanyColumnsEnumDTO { [EnumMember] CompanyName = 0, [EnumMember] City = 1, [EnumMember] PostCode = 2, }
This should be a conversion problem, because null is accepted in the column:
var dto = new SearchParametersCompanyDTO { PageIndex = pageIndex, PageSize = defaultPageSize, Term = term, Column = null };
Any idea?
source share