我是新手,asp.net
并且c#
..我被要求分析门户网站的代码。请查看以下代码并建议我一种调用FromDatabase方法的方法。我已经浏览了解决方案中的所有文件,但没有调用语句。
这里的 Account 和 Utility 是类。
public static Account FromDatabase(DbDataRecord dr)
{
return new Account(
Utility.StringFromNull(dr.GetValue(0)),
Utility.StringFromNull(dr.GetValue(1)),
Utility.IntFromNull(dr.GetValue(2)),
Utility.StringFromNull(dr.GetValue(3)),
Utility.StringFromNull(dr.GetValue(4)),
Utility.StringFromNull(dr.GetValue(5)),
Utility.DateTimeFromNull(dr.GetValue(6))
);
}
我可以通过什么其他方式返回值而不是 return new Account()。
提前致谢!