Ambiguous extension method

前端 未结 4 1105
太阳男子
太阳男子 2020-12-28 13:13

I am making the following call to an extension method:

database.ExecuteScalar(command).NoNull(string.Empty);

I get an error t

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-28 13:22

    You should change the signature of one (or both of them) to differentiate what it does. This seems like duplication of code somewhere unless these do different things. Though if they do different things I would think you would differentiate that in the names. I'd recommend creating some sort of enumeration (a flag maybe) to pass as an extra argument to one of the methods.

提交回复
热议问题