【发布时间】:2011-12-19 06:01:14
【问题描述】:
我们通常在接受xml并将结果集作为xml返回的数据库上编写存储过程。我正在考虑为如下的数据库调用提供抽象
示例
public List<Person> GetAllPeople()
{
string requestXml = "<Request><Type>GetAllPeople</Type></Request>";
//execute a procedure with above xml as input
//load the response xml into dataset
//foreach record instantiate Person & add to list
return List<Person>();
}
以便团队可以使用强类型对象而不是松散耦合的 Xml 字符串。我认为这是 ORM 所做的工作对吗?或者我应该编写自己的数据访问层来返回对象而不是数据集和数据表。所以问题是
-
ORM 是否适合这种类型的数据访问?
-
抽象数据库调用的正确路径是什么?
规格
SQL Server 2005、.NET 2.0、ASP.NET 2.0、C# 2.0
【问题讨论】:
标签: xml sql-server-2005 orm dataset data-access-layer