質問

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.

役に立ちましたか?

解決

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)
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top