Inheritance is not supported

Dec 30, 2010 at 5:44 PM

Hi,

The very first method I've faced failing is GetEntityForAssociationEnd.

When I changed the body to:

 

try
{
	return
		(from e in entities
		where e.Name == associationMember.Name
		select e).First();
}
catch
{
	throw new Exception(string.Format("Couldn't find entity {0} among following entities: {1}.", 
		associationMember.Name, string.Join(", ", (from e in entities select e.Name))));
}

 

Error	1	Running transformation: System.Exception: Couldn't find entity User amoung following entities: Address, Person, Program.
   at Microsoft.VisualStudio.TextTemplatingC7356ACC1DBB3BB9907CECB6FF10E2E0.GeneratedTextTransformation.GetEntityForAssociationEnd(EntityType[] entities, AssociationEndMember associationMember)
   at Microsoft.VisualStudio.TextTemplatingC7356ACC1DBB3BB9907CECB6FF10E2E0.GeneratedTextTransformation.GenerateM2MData()
   at Microsoft.VisualStudio.TextTemplatingC7356ACC1DBB3BB9907CECB6FF10E2E0.GeneratedTextTransformation.TransformText()
   at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)		1	1	

User is inherited from Person.

Yours,
PoganeZz

Dec 30, 2010 at 6:04 PM

 

Sorry, the issue was that after I renamed an entity in the model, the referencing entity had an old value of the Role stored. That's why it didn't work. Fixing the model helped.

Yours,
PoganeZz