views:

52

answers:

1

Does WCF RIA services supports custom methods? also in which dll can i find the "[Custom]" attribute?

A: 

Hi, Yes WCF RIA services can support custom methods.

You'd specify decorate your custom methods with the [Invoke] attribute. EG:

[EnableClientAccess()]
public class TestDomainService : LinqToEntitiesDomainService<TestEntities>
{
  [Invoke]
  public Test CustomMethodFetch(Guid testId)
  {
    ...
    return foundTest; 
  }
}

.. and you would call it by ...

var ctx = new TestDomainContext();

ctx.CustomMethodFetch( testId, (op) =>
{
  if (op.HasError)
    // Handle errors.
  else
  {
    var testEntity = op.Value;
    // Do stuff.
  }
});
Rus