您的位置:首页 > 大数据 > 人工智能

Domain Service,RIA Services使用的几个注意问题

2009-06-08 15:02 721 查看
1.在RIA Services自动生成代码时,自定义方法.

给方法加上PreserveName

[Query(PreserveName=true)]
public IQueryable<Personal> GetPersonalByPersonalId(Guid personalId)


2.生成的代码是不能重载的,需要使用不同的方法名,如:

public IQueryable<Personal> GetPersonals()

与

public IQueryable<Personal> GetPersonalsById(int id)


3.RIA Service中的几个方法关键字

 Insert
o “Insert”, “Add”, “Create” prefixes
o Method signature : void InsertX(T entity), where T is an entity Type

 Update
o “Update”, “Change”, “Modify” prefixes
o Method signature : void UpdateX(T current, T original), where T is an entity Type

 Delete
o “Delete”, “Remove” prefixes
o Method signature : void DeleteX(T entity), where T is an entity Type

 Query
o “Get”, “Fetch”, “Find”, “Query”, “Retrieve”, “Select” prefixes
o Method signature returning IEnumerable<T> or IQueryable<T> where T is an entity Type, and taking zero or more parameters

 Resolve
o “Resolve” prefix
o Method signature : bool ResolveX(T curr, T original, T store, bool isDelete) where T is an entity type

4.[ServiceOperation]属性

[ServiceOperation]

public String GetIp()

{

return "";
}

5.[Custom]属性

[Custom]
public void ApproveEmployee(Employee changedEmployee, ...)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: