Developing Open RIA Services Disable client entity generation  Viewed 16780 time(s), 5 post(s)., 2/10/2014 8:59:15 PM - by UKIan

UKIan
UKIan 2/10/2014 8:59:15 PM

Hi there,
I'm looking for a way to simply disable code generation of entities on the client. I want all other code to generate, the entities however now reside in a portable library and I'd like it to use those.

I guess there are two questions. First, is there already a configuration option for this? Second, if not, can you point me to roughly where in the code to look and I should be ok from there. I'm not after line numbers, simply narrowing it down to a project would be a help at this point :)

Many thanks in advance.

This content has not been rated yet. 
91 Reputation 12 Total posts
1
ColinBlair
ColinBlair 2/10/2014 10:34:28 PM

If you are using Open RIA Services, just remove the code generation NuGet package from the project. Without the code generation NuGet package no code generation will happen.

This content has not been rated yet. 
1539 Reputation 130 Total posts
2
UKIan
UKIan 2/11/2014 9:05:06 AM

I still want it to generate the DomainContext classes, just not the entity objects. I was looking at an alternative solution involving "normal" RIA services and the T4 nuget package for it. 90pc of the solution works, but it tries to validate the domainContext at the end of its generation and throw s "Type already shared" exception which prevents it building. So I'm hoping to be able to disable that part with OpenRia.

Many thanks for taking the time to respond.

This content has not been rated yet. 
91 Reputation 12 Total posts
3
ColinBlair
ColinBlair 2/12/2014 5:35:24 PM

Are you willing to make your own code changes? In the ClientCodeGenerator.partial.cs file there are two lines that log the Type already shared error. They are lines 181 and 200. My suggestion would be to try changing that to LogWarning instead of LogError, compile your own copy of OpenRiaServices.DomainServices.Tools.TextTemplate, and see if that fixes your problem.

If it does, I will look at building that in somehow.

This content has not been rated yet. 
1539 Reputation 130 Total posts
4
UKIan
UKIan 2/12/2014 11:24:37 PM

Yep, that's perfect. I spent half an hour this morning making it build (I'm using Visual Studio 2013) and searching for the errors, so that's very affirming :)

The build issues I had were with the portable library. I didn't dig too much into it, just replaced various problem sections with sections from a new empty portable library. Everything builds fine after that though.

Many thanks again.

This content has not been rated yet. 
91 Reputation 12 Total posts
5