Last post Sep 30, 2010 06:13 PM by yacine
Jun 07, 2010 10:51 PM|zerosleep|LINK
I have a simple navigation property between two pocos (parent/child) and I'm using the [Key], [Include], [Association] attributes to notate the relationships. However, when DomainModelProvider attempts to load my model -- I get this error:
[InvalidOperationException: Can't find To column for column 'myColumnName']
Rather than parade my horribly broken code around -- I was wondering if anyone has a good resource or guides on how to use DomainService/Dynamic Data together using custom POCO models with 1:1/1:M relationships -- rather than EF/L2SQL driven data models.
I figure I'd start there before giving up.
Jun 08, 2010 12:06 PM|sjnaughton|LINK
Hi Zerosleep, you will probably frin some good resources on the WCF RIA Services form here
WCF RIA Services note you can usually use the same logon as on this forum [:)]
Jun 08, 2010 04:25 PM|zerosleep|LINK
I've looked around a bit. Most of the articles I've located are assuming at a minimum that you're using L2SQL/L2ENT at some point in the stack. Any POCO only implementations that I've seen are using relationships in the context of silverlight, data services.
So my real question is (asking publicly per David):
Does release 1 of the dynamic data w/ domain services project support the display of 1 way navigation properties in the context of dynamic data (4.0)? Specifically -- when displaying a particular column from the end of the relationship?
My data model is purely in memory using POCOs -- attributed with [Key]'s where appropriate and I've confirmed the domain service is returning the related entities -- but it seems dynamic data doesn't pick up the relationship by default. The column is displayed
in the various views -- but empty.
Jun 09, 2010 06:57 AM|sjnaughton|LINK
Hi Brian, I've asked around and on of the team suggested the list below:
There are a few POCO samples on our Code gallery site -
In particular there is one POCO example …
Here is another example of the repository pattern that uses Nhibernate as the ORM and SQL as the database (you could replace NHibernate + SQL with a web service …)
Hope that helps [:)]
Jun 09, 2010 09:23 AM|zerosleep|LINK
Just to clarify -- I'm attempting to use the ASP.NET 4 Dynamic Data Domain Service Web Applicaiton project template.
Although these are both great example RIA services --- I'm looking for something specific to Dynamic DATA. Both of the above happen to be Silverlight clients. The problem I'm having is down at the dynamic data/metamodel/table level. The domain services part
is working great and returning data that I would expect.
I'll keep digging!
Jun 09, 2010 11:18 AM|sjnaughton|LINK
Sorry Brian, there is nothing specific to DD and I've never done any POCO stuff myself the best thing is to look at the POCO samples and then try to apply that to DD. It should work with DD Domain Service Projec POCO and RIA Services DomainService is generic
and what works in one should work in any other.
Jun 21, 2010 06:17 PM|zerosleep|LINK
Dug a little deeper. I was missing foreign key MetaColumn/Associations in my Metamodel. So, it would appear that in order to use my own completely seperate DAL w/ POCOs that have relationships -- I'll need to implement a custom DomainModelProvider or DomainService
description. However, by simply adding this to my domain service class:
I was able to get 99% of the way there, swapping out my Fake (Mocked) DAL and my EF DAL without any problems on the DD side. It's not as cleanly seperated as I wanted, but it's a good start until I can find or write a generic description provider of my own.
Sep 30, 2010 05:07 PM|yacine|LINK
I'm about 3 months late in this discussion but i'll give a shot anyway - though you may be asleep by now ;)
You mentioned implementing a custom DomainModelProvider, is that for the purpose of exposing your separate POCO model to your dynamic data website ? Wondering if that could apply to the scenario of a domain service being deployed independently of the web
Sep 30, 2010 05:34 PM|zerosleep|LINK
I believe the domain service is setup as a WCF end point, so I wouldn't be surprised if there is a way you could host it somewhere else and just setup the appropriate web.config to point to it.
My problem ended up being solved by simply setting up [Include][Association(...)] attributes the right way for the relationships I needed. I did look at the sample code for creating a domain service description/model provider, but it was more than I needed
to implement at the time.
Sep 30, 2010 06:13 PM|yacine|LINK
Yes domain services are exposed as WCF services, by default through a WebHttpBinding. So it's quite easy to access one from a remote client, the problem is with the Dynamic Data part, which needs to consume the remote metamodel. So the answer might indeed
be in the domain model provider. Could you tel me which sample code you were looking at ?