Вопрос

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