此方法采用输入参数(电子邮件地址)。如果它存在于表中,则返回值(电子邮件),如果不存在,则不应返回任何值,但此方法始终返回相同的值(参数)。
我错过了什么吗?
private static string findEmailSubscription(string emailAddress)
{
try
{
//Fetch email Address
using (DataAccess data = new DataAccess("Email"))
{
DynamicEntity[] emails = data.Adapter.Execute(
"SELECT EmailAddress FROM table " +
"WHERE EmailAddress=@EmailAddress; ",
ExecuteCommandType.Text,
new Object[,] {
{"EmailAddress", emailAddress ?? (object)DBNull.Value}
});
}
return emailAddress;
}