This is a migrated thread and some comments may be shown as answers.

[Solved] How to share my custom classes??

4 Answers 139 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
magozeta
Top achievements
Rank 1
magozeta asked on 30 Sep 2009, 03:38 PM
Hello all!
I'm trying OpenAccess ORM and I have a question.

I watched some webcast on telerikTv and I understood how to expose my classes from db with Astoria to Silverlight.
But I need to write some custom classes in my solution and I want view this classes in Service's project and in Silverlight project.
With RIA, I can do this but with this ORM that not support RIA?

how can I do?
thanks

4 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 02 Oct 2009, 01:50 PM
Hi magozeta,

Can you share some additional information over those classes. Are those classes supposed to be persistent ? Do you want them to be some kind of wrapper classes for your persistent classes. Please shed some light over your goal in order for us to be able to provide you with an adequate solution.
Thank you in advance.

Sincerely yours,
Petar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Brendan Enrick
Top achievements
Rank 1
answered on 05 Oct 2009, 03:09 PM
Hi magozeta,

Please let me know if I understand you correctly here.

You are using Silverlight as the UI for an application which has a web site as the back end.

You are planning on using some services to handle the interaction between the two layers of your application.

On the server side you are using OpenAccess to handle the data persistence.

You want to have classes which can be used on the server as well as on the Silverlight.

If all of those assumptions are correct then you will want to create a 3rd project in your solution that is a Silverlight class library. That project can then be referenced by both the client and the server in your application. Since that class library cannot reference the OpenAccess dlls you will need to create methods that map all of the columns from your OpenAccess classes to the ones you've created in that library.

If you have any questions or if I've made any faulty assumptions please let me know.

Brendan
0
Charlie
Top achievements
Rank 1
answered on 19 Oct 2010, 05:37 PM
I have a similar task  - trying to expose ORM objects via WPF client and WCF service.
Is this possible?   via Class library (DLL).

The reason for exposure is to simplify serialization/ deserialzation. Both client and WCF must remain stateless.

thanks.
0
Serge
Telerik team
answered on 22 Oct 2010, 05:56 PM
Hi Charlie,

 It is usually not a good idea to use the same object you got from OpenAccess and transport them over the WCF service. As all of them are usually bound to a context (or scope), then cannot function without it. You can use the Data Services Wizard to create classes based on your OpenAccess classes that you can use for this purpose. The wizard will also generate your service code and assemblers for you object so that you can easily go from an OpenAccess object to a DTO object.

You could also use the approach from the following sample: WCF Northwind N-Tier Application. There the classes are additionally written by the user and the assembler pattern is being used to populate these objects.

I do hope this is helpful, but if you feel this is not the case please let us know.

Regards,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
magozeta
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Brendan Enrick
Top achievements
Rank 1
Charlie
Top achievements
Rank 1
Serge
Telerik team
Share this question
or