3 keys in the relationship table

Nov 3, 2011 at 10:57 PM

Hi,

Great job with this framework. Excellent work.

I have a situation, where the client generated code is giving a compilation error.

I have 6 tables, which define a set of cascading comboboxes. This worked fine, before I added M2M4RIA to my code.

I have:

Level0

Level1

Level2

Level3

Because the selection of Level0, Level1 and Level2 are required. Their relationship is defined in a single table Level1_2 (Level0ID, Level1ID, Level2ID)

and Level3 is optional, so that relationship is defined in Level2_3 (Level2ID, Level3ID)

Now in my entity model Level2_3 is hidden, but Level1_2 is shown. This was the case before AND after M2M4RIA.

Is there a way to support a m2m relationship like Level1_2?

 

 

Coordinator
Nov 4, 2011 at 8:08 AM

Hi,

What compilation errors do you get since you're using m2m4ria?

As far as I understand your case, Level1_2 is not strictly an m2m relation, because it is a relation between 3 rather than 2 tables. This kind of relations is not supported by m2m4ria (but also not by EF). I think the way m2m4ria is designed it should be possible to add such relations though.

Still, I don't fully get the reason for button level0, level1, and level2 in one table.

Nov 4, 2011 at 2:30 PM
Edited Nov 4, 2011 at 3:12 PM

Thank you for your response. Updated: They are in one table, because the choice you make in Level0 and Level1 affects Level2. So in this special case, Level0 and Level1 doesn't have direct correlation.

In terms of errors, I can't tell whether it's related to this or not (I'm guessing not), but my client generated code is claiming non of my join table entities exist.

I've traced issue down to my Server generated code, which is not producing ".g.cs" files with the service and entity code. Both tt files are generating ".cs" files, which looks a lot like the tt code. I'm not getting any errors.

I also saw an issue, when trying to create a new DomainService, it generates the DomainService.cs file, but before it can generate the metadata class, it gives an error about web.config saying "domainServices" already exists. I tried removing this, but then it complains that this doesn't exist before generating the DomainService class. This is not an issue for me right now, as I've had previously generated this code. Just putting it out there.

I'll report back, if I can figure out the code generation problem. But any ideas would be much appreciated.

 


Nov 4, 2011 at 2:37 PM

Well I figured out my problem. I was using TextTemplatingFilePreprocessor instead of TextTemplatingFileGenerator as my Custom Tool. I guess I picked the wrong template, when creating the tt files. If you need any help, rewriting the intro setup section to include step by step instructions, I'd be glad to help out.

Coordinator
Nov 4, 2011 at 10:33 PM
Hi Duluca,

All suggestions for improving the intro (and other) section(s) are welcome!

Merijn

On 4-11-2011 15:37, duluca wrote:

From: duluca

Well I figured out my problem. I was using TextTemplatingFilePreprocessor instead of TextTemplatingFileGenerator as my Custom Tool. I guess I picked the wrong template, when creating the tt files. If you need any help, rewriting the intro setup section to include step by step instructions, I'd be glad to help out.