Question

So i have a chunk of code like this:

public List<DynamicBusinessObject> GetSearchResultList(Search search, List<CategoryAttribute> listCatAttrib, string sortBy, int startRow, int pageSize, [Optional, DefaultParameterValue("")] string state, [Optional, DefaultParameterValue("")] string condition, [Optional, DefaultParameterValue("")] string manufacturer)

I'd like to know how instead of a default value of "" (empty string) i can instead set it to null? Tried using DBNull.value but it didn't like that.

Était-ce utile?

La solution

use the = null

public List<DynamicBusinessObject> GetSearchResultList(Search search, List<CategoryAttribute> listCatAttrib, string sortBy, int startRow, int pageSize, string state = null, string condition = null, string manufacturer = null)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top