msawczyn/EFDesigner

'KeyBuilder' does not contain definition for 'Ignore' in EF Core

RuiAlias opened this issue · 0 comments

Hi, I'm getting the following error with v1.3.0.8pre-2:
'KeyBuilder' does not contain definition for 'Ignore'

I believe the relevant code is

// primary key code segments must be output last, since HasKey returns a different type
List<ModelAttribute> identityAttributes = modelClass.IdentityAttributes.ToList();
if (identityAttributes.Count() == 1)
segments.Add($"HasKey(t => t.{identityAttributes[0].Name})");
else if (identityAttributes.Count() > 1)
segments.Add($"HasKey(t => new {{ t.{string.Join(", t.", identityAttributes.Select(ia => ia.Name))} }})");
}
}
foreach (ModelAttribute transient in modelClass.Attributes.Where(x => !x.Persistent))
segments.Add($"Ignore(t => t.{transient.Name})");