views:

129

answers:

0

I've done some silverlight2 apps that access a database. I did some clunky stuff so that i could use some custom classes on both the webservice end and also in silverlight. I want to use these custom classes because it houses all the business logic. With silverlight 3 i see all these demo's where they are using RIA services. These all use the entity data model. Problem is i haven't been able to find anything that tells how to make the entity data model work with custom classes instead of just going straight to the database and/or using stored proc's. So, what is a good option to use to use custom classes for my data access layer while at the same time still being able to use these with silverlight and blend so that all these great binding features can work.

Hope that makes sense. thanks shannon

well i've done some more playing.. was wondering if this looks like an approach that coudl work

i'm trying to use ADO Data Services and then see if i can get RIA to ride on top. Does that sound like a plan.. i create a class called Course.vb.

`Imports System.Data.Services.Common

_ Public Class Course

Region "Properties"

''' <summary>
''' The course ID
''' </summary>
Private mCourseID As Integer

Public Property CourseID() As Integer
    Get
        Return mCourseID
    End Get
    Set(ByVal value As Integer)
        mCourseID = value
    End Set
End Property

has some more properties and then a method

Public Shared Function GetCourses() As List(Of Course)
    Return New List(Of Course)(New Course() {New Course() With {.CourseID = 1, .Creadit = 3, .Days = 3, .Title = "Algorithms"}, New Course() With {.CourseID = 2, .Creadit = 5, .Days = 5, .Title = "Data Structures"}, New Course() With {.CourseID = 3, .Creadit = 5, .Days = 5, .Title = "Databases"}})
End Function

and a class called CourseDataContext.vb

Public ReadOnly Property Courses() As IQueryable(Of Course)
    Get
        Return Course.GetCourses().AsQueryable()
    End Get
End Property

from there i tried to get a ADO.net Data Service. I changed the it to point to my CourseDataContext and tried to do a browse on the ADO.net data service. it comes up.. but it's not listing off what is in the list. Didn't know if you'd have a moment to review and post a response back.. anyone for that matter.

thanks

shannon

**Well.. i figured out the data not showing issue.. needed to change something in the ADO.NET data services. now it's on to trying to see if i can get this wired up to RIA services. So if anyone has a suggestion.. please shoot me a note.

Thanks