支持的特性也相當多
具體的使用方法可以參見園子裡面其它人寫的文章或官方文檔
通常
我的辦法是不直接使用它生成的解決方案
這時我們的Service層看起來可能是這個樣子:
public class UsersFacade : UsersServiceBase
{
public UsersFacade()
: base() { }
public Users ValidateUser(string username
{
SqlFilterBuilder<UsersColumn> filter = new SqlFilterBuilder<UsersColumn>();
filter
filter
filter
int count =
TList<Users> users = DataRepository
if (users
return users[
else
return null;
}
public Users ValidateUserAlter(string username
{
TList<Users> users = Find(string
if (users != null && users
return users[
else
return null;
}
public Users ValidateUserThird(string username
{
GB
filter
filter
TList<Users> users = GB
if (users != null && users
return users[
else
return null;
}
}
再看看單元測試的代碼:
[TestFixture]
public class SampleFixture
{
Users testUser = new Users();
[TestFixtureSetUp]
public void Setup()
{
Users u = new Users();
u
u
u
testUser
UsersFacade fa = new UsersFacade();
fa
}
[TestFixtureTearDown]
public void Clearup()
{
UsersFacade f = new UsersFacade();
f
}
[Test]
public void GetAllUserTest()
{
UsersFacade facade = new UsersFacade();
//TList<Users> list = facade
TList<Users> list = facade
Console
Assert
Assert
}
[Test]
public void ValidateUserTest()
{
UsersFacade facade = new UsersFacade();
Users u = facade
Assert
Assert
}
[Test]
public void ValidateUserAlterTest()
{
UsersFacade facade = new UsersFacade();
Users u = facade
Assert
Assert
}
[Test]
public void ValidateuserThirdTest()
{
UsersFacade facade = new UsersFacade();
Users u = facade
Assert
Assert
}
}
這樣我們就只需要管理我們的生成配置文件就可以了
From:http://tw.wingwit.com/Article/program/net/201311/12822.html