tags:

views:

570

answers:

1

I would like to ".NET RIA Service"-enable my custom data model (BLL/DAL). Are there interfaces I have to implement to enable this functionality or all I have to do is create a Domain Service? If so, how can tell my Domain Services about my BLL? For Astoria, one has to implement IQueryable and IUpdatable interfaces for CRUD capabilities. Is this the same for RIA Services?

+2  A: 

All you have to do is create a DomainService. The DomainService will have methods like GetMyObjects() and InsertObject(MyObject object) that either return or accept objects for your BLL - that's how you tell the DomainService about your classes. Your Get***() methods in the DomainService need to return a generic IQueryable, but you shouldn't need to implement it yourself. There's an AsQueryable() extension method that I believe you can use on a generic List, IEnumerable or Array that will convert any list of objects to an IQueryable. It should be reasonably easy to create a DomainService to wrap your existing BLL. Brad Abrams's has a great post describing this scenario: http://blogs.msdn.com/brada/archive/2009/07/22/business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update-part-6-poco-and-authentication-provider.aspx

James Cadd