Open
Description
Version 9.0.0-preview.7.24405.3 cannot Create Compiled Model for Property public string Source {get; set;}
Simplified Entity Type (without annotation).
public partial class LoginLog
{
public string Id {get; set;}
public string Source {get; set;}
public string ProgrammVersion {get; set;}
public string? Protokoll {get; set;}
public System.DateTime Datum {get; set;}
public bool Geloescht {get; set;}
public System.DateTime ModDte {get; set;}
public string ModUser {get; set;}
}
Generated Annotation
......
public static void CreateAnnotations(RuntimeEntityType runtimeEntityType)
{
var id = runtimeEntityType.FindProperty("Id")!;
var datum = runtimeEntityType.FindProperty("Datum")!;
var geloescht = runtimeEntityType.FindProperty("Geloescht")!;
var modDte = runtimeEntityType.FindProperty("ModDte")!;
var modUser = runtimeEntityType.FindProperty("ModUser")!;
var programmVersion = runtimeEntityType.FindProperty("ProgrammVersion")!;
var protokoll = runtimeEntityType.FindProperty("Protokoll")!;
var source = runtimeEntityType.FindProperty("Source")!;
var key = runtimeEntityType.FindKey(new[] { id });
key.SetPrincipalKeyValueFactory(KeyValueFactoryFactory.CreateSimpleNullableFactory<string, int>(key));
key.SetIdentityMapFactory(IdentityMapFactoryFactory.CreateFactory<string>(key));
runtimeEntityType.SetOriginalValuesFactory(
ISnapshot (InternalEntityEntry source) =>
{
var entity5 = ((LoginLog)(source.Entity));
return ((ISnapshot)(new Snapshot<string, DateTime, bool, DateTime, string, string, string, string>((source.GetCurrentValue<string>(id) == null ? null : ((ValueComparer<string>)(((IProperty)id).GetValueComparer())).Snapshot(source.GetCurrentValue<string>(id))), ((ValueComparer<DateTime>)(((IProperty)datum).GetValueComparer())).Snapshot(source.GetCurrentValue<DateTime>(datum)), ((ValueComparer<bool>)(((IProperty)geloescht).GetValueComparer())).Snapshot(source.GetCurrentValue<bool>(geloescht)), ((ValueComparer<DateTime>)(((IProperty)modDte).GetValueComparer())).Snapshot(source.GetCurrentValue<DateTime>(modDte)), (source.GetCurrentValue<string>(modUser) == null ? null : ((ValueComparer<string>)(((IProperty)modUser).GetValueComparer())).Snapshot(source.GetCurrentValue<string>(modUser))), (source.GetCurrentValue<string>(programmVersion) == null ? null : ((ValueComparer<string>)(((IProperty)programmVersion).GetValueComparer())).Snapshot(source.GetCurrentValue<string>(programmVersion))), (source.GetCurrentValue<string>(protokoll) == null ? null : ((ValueComparer<string>)(((IProperty)protokoll).GetValueComparer())).Snapshot(source.GetCurrentValue<string>(protokoll))), (source.GetCurrentValue<string>(source) == null ? null : ((ValueComparer<string>)(((IProperty)source).GetValueComparer())).Snapshot(source.GetCurrentValue<string>(source))))));
});
.....
because the property is named source and the parameter of SetoriginalValuesFactory too it doesn't compile because the source parameter from SetOriginalValuesFactory hides the source Property.
Workaround: rename the var source = .....
to for example var sourceProp = ....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment