Are there any decent articles online that explain in detail how the conventions work in EF 4.1? There was an article linked from Scott Gu's blog, but it was dated 2010, I think it was then in CTP 4. Not sure if the conventions have beem modified since then. But I don't understand how it works. For example how does it know to use the table SkillType if I have this code (what does it look for?):
public DbSet<SkillType> SkillTypes { get; set; }
This is just 1 of my confusions, then there is foreign keys, primary keys, etc. I need to familiarise myself with these conventions so any goof articles that I can read please let me know. I did Google and couldn't get anything solid and concrete.
There is no real walkthrough. You can find basic description of all conventions in MSDN. My answer on MSDN forum posts links to all conventions.
There was really big change in conventions since CTP5. First of all you cannot add custom conventions any more - this feature was removed from final version. If you define DbSet
as in your example it is not job for convention to define table. There is some mechanism (probably using reflection) which finds all defined sets in the contexts and starts mapping generation.
A pretty good and simple explanation of Code First Conventions is available on MSDN, nicely titled: Code First Conventions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With