Understanding Entity Framework 4.1 Conventions

Are there any decent articles on the Internet that explain in detail how conventions work in EF 4.1? There was an article related to Scott Gug’s blog, but it was dated 2010, I think it was then in CTP 4. Not sure if the agreements have changed since then. But I don’t understand how it works. For example, how does he know to use the SkillType table if I have this code (what is he looking for?):

public DbSet<SkillType> SkillTypes { get; set; } 

This is just one of my perplexities, then there are foreign keys, primary keys, etc. I need to read these conventions so that any goof articles I can read let me know. I did Google and could not get anything solid and concrete.

+6
source share
3 answers

There is no real walkthrough. You can find a basic description of all conventions on MSDN. My answer on the MSDN forum posts links to all conventions.

There were really big changes in agreements with CTP5. First of all, you can no longer add user agreements - this function has been removed from the final version. If you define a DbSet , as in your example, this is not a job to define a table. There is some mechanism (possibly using reflection) that finds all the defined sets in contexts and triggers the formation of the mapping.

+2
source

A pretty good and simple explanation of the first code conventions is available on MSDN, nicely entitled: First code conventions .

+1
source

I also like and recommend the ADO.Net team blog :)

http://blogs.msdn.com/b/adonet/

0
source

Source: https://habr.com/ru/post/887795/


All Articles