Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Unassigned: Conventions cannot access dotted properties [1392]

$
0
0
With this model
```
public class Comment
{
public int ID { get; set; }
public Inner Sub { get; set; }

public class Inner
{
public int I { get; set; }
}
}
```

I cannot access the property 'I' with either of the following conventions

```
modelBuilder.Types()
.Where(w => w.Name == "Comment")
.Configure(c => c
.Property("I").HasColumnName("J"));
```

or with ```"I"``` replaced by ```"Sub.I"``` or ```"Inner.I"```

or

```
modelBuilder.Types<Comment>()
.Configure(c => c
.Property(p => p.Sub.I).HasColumnName("J"));
```

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>