当前位置: 代码迷 >> 综合 >> Domain Service,RIA Services使用的几个注意问题
  详细解决方案

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

热度:43   发布时间:2023-12-22 06:26:19.0

1.在RIA Services自动生成代码时,自定义方法.

给方法加上PreserveName

 

 

 

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

 

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, ...)

  相关解决方案