Answered by:
Need Help of RIA Services

Question
-
I need to display child table value in grid of the parent table. In Silverligth 4 Application ans MS SQL 2008\R2 Server .and RIA Services + EF.
For Example : Table - TypesOfStreet (FK,PK IdTypeOfStreet [ uniqueidentifier] , TypeOfStreet [nvarchar(50)] , ShortName [nvarchar[10] )
and Table - Streets (PK IdStreet [uniqueidentifier ], StreetName [nvarchar (50) ], IdTypeOfStreet [uniqueidentiffier] , DisplayName ([nvarchar (100))
DisplayName need to Display the retrieved value ShortName from TypesOfStreet (by Id TypeOfStreet ) plus the Value StreetName from the table - Streets .Also I need to display in grid a value of retrieveing TypeOfStreet of Table Types Of Street . How it will better to Do? To Customize it in EF creating a new Complex Type and imoprt store proced from MS SQL and then generate by Domain Service (RIA Services )
Or what?
Actually this value is that User enter on form. How me to better to do ? On my solution I have like this things in Example with like this entities 45 pcs.
Need I create for each Such entitity a seperate service and then use a service including all those services ?
Friday, September 17, 2010 11:45 AM
Answers
-
I would create a DTO. Then you can have whatever fields you want. What you do is create the object and the write a select new query:
from street in entities.street from tos in entities.TypesOfStreet where street.IdStreet = passedInID select new StreetDTO { Title = tos.ShortName
... }RIA will see you have a query for StreetDTO and will project it into the client. If you want to save with this object then just break it up when you pass it back to the server and create the two objects.
- Marked as answer by Dalex83 Thursday, September 23, 2010 10:56 AM
Friday, September 17, 2010 1:52 PM -
On 9/18/2010 12:24 AM, Dalex83 wrote:> Dto is good staff, but wiil it be better then that CUSTOMIZing EF or RIA> Service? Actually will it be better RIA Services + Open DAta?WCF RIA is designed to work with Linq-2-SQL or ADO.NET Entity Frameworkdirectly and not DTO(s).Here is an example of the technology in action where you bind the entityor entities in a collection to a control. The middle tier is built foryou regarding WCF and the Model, and the middle tier takes care of theCRUD operations triggered by a control's functionality, which the middletier is customizable by the developer.<http://geekswithblogs.net/ranganh/archive/2009/12/14/using-wcf-ria-services-without-silverlight-in-visual-studio-2010.aspx>I even went to a n-tier architecture using WCF RIA with a UI/BLL/WCFRIA/DAL solution just playing with it and the model created in the DAL.In this type of architecture, one can use DTO(s) at the BLL where youmap the entity to a DTO and a DTO to a entity to/from the DAL and withDTO(s) being used at the UI.
- Proposed as answer by Michael Sun [MSFT]Microsoft employee Tuesday, September 21, 2010 2:59 AM
- Marked as answer by Dalex83 Tuesday, September 21, 2010 6:29 AM
Saturday, September 18, 2010 5:21 AM -
All replies
-
I would create a DTO. Then you can have whatever fields you want. What you do is create the object and the write a select new query:
from street in entities.street from tos in entities.TypesOfStreet where street.IdStreet = passedInID select new StreetDTO { Title = tos.ShortName
... }RIA will see you have a query for StreetDTO and will project it into the client. If you want to save with this object then just break it up when you pass it back to the server and create the two objects.
- Marked as answer by Dalex83 Thursday, September 23, 2010 10:56 AM
Friday, September 17, 2010 1:52 PM -
"Dalex83" wrote in message news:3ca7227f-4ec3-45af-bbc3-c08095d90ebc...
I need to display child table value in grid of the parent table. In Silverligth 4 Application ans MS SQL 2008\R2 Server .and RIA Services + EF.
For Example : Table - TypesOfStreet (FK,PK IdTypeOfStreet [ uniqueidentifier] , TypeOfStreet [nvarchar(50)] , ShortName [nvarchar[10] )
and Table - Streets (PK IdStreet [uniqueidentifier ], StreetName [nvarchar (50) ], IdTypeOfStreet [uniqueidentiffier] , DisplayName ([nvarchar (100))
DisplayName need to Display the retrieved value ShortName from TypesOfStreet (by Id TypeOfStreet ) plus the Value StreetName from the table - Streets ..Also I need to display in grid a value of retrieveing TypeOfStreet of Table Types Of Street . How it will better to Do? To Customize it in EF creating a new Complex Type and imoprt store proced from MS SQL and then generate by Domain Service (RIA Services )
Or what?
Actually this value is that User enter on form. How me to better to do ? On my solution I have like this things in Example with like this entities 45 pcs.
Need I create for each Such entitity a seperate service and then use a service including all those services ?
my response -------------------------------------------------------------------
You can post to this forum and get help.
http://forums.silverlight.net/forums/53.aspx
Friday, September 17, 2010 11:56 PM -
Dto is good staff, but wiil it be better then that CUSTOMIZing EF or RIA Service? Actually will it be better RIA Services + Open DAta?Saturday, September 18, 2010 4:24 AM
-
On 9/18/2010 12:24 AM, Dalex83 wrote:> Dto is good staff, but wiil it be better then that CUSTOMIZing EF or RIA> Service? Actually will it be better RIA Services + Open DAta?WCF RIA is designed to work with Linq-2-SQL or ADO.NET Entity Frameworkdirectly and not DTO(s).Here is an example of the technology in action where you bind the entityor entities in a collection to a control. The middle tier is built foryou regarding WCF and the Model, and the middle tier takes care of theCRUD operations triggered by a control's functionality, which the middletier is customizable by the developer.<http://geekswithblogs.net/ranganh/archive/2009/12/14/using-wcf-ria-services-without-silverlight-in-visual-studio-2010.aspx>I even went to a n-tier architecture using WCF RIA with a UI/BLL/WCFRIA/DAL solution just playing with it and the model created in the DAL.In this type of architecture, one can use DTO(s) at the BLL where youmap the entity to a DTO and a DTO to a entity to/from the DAL and withDTO(s) being used at the UI.
- Proposed as answer by Michael Sun [MSFT]Microsoft employee Tuesday, September 21, 2010 2:59 AM
- Marked as answer by Dalex83 Tuesday, September 21, 2010 6:29 AM
Saturday, September 18, 2010 5:21 AM -
Actually I am looking for something like that but i need mostly to do cashes .
Monday, September 20, 2010 9:52 AM -