Construct DbGeography point from Latitude and Longitude doubles?

In short, no there isn’t. SqlGeography has an appropriate method: Microsoft.SqlServer.Types.SqlGeography.Point(latitude, longitude, srid); … but you would then have to convert to DbGeography anyway. If you are interested in this, see a previous answer of mine on converting: DbGeography to SqlGeography (and back) That said, I completely agree with Raphael Althaus in that you should … Read more

Why is my Entity Framework Code First proxy collection null and why can’t I set it?

As you correctly observed in the answer to your own question, removing the “virtual” keyword from the collection properties works around the problem, by preventing the Entity Framework from creating a change tracking proxy. However, this is not a solution for many people, because change tracking proxies can be really convenient and can help prevent … Read more

Confusion over EF Auto Migrations and seeding – seeding every program start

The fact that the Seed method ran only when the database changed was quite limiting for the database initializers that shipped in EF 4.1. It was limiting because sometimes you needed to update seed data without changing the database, but to make that happen you had to artificially make it seem like the database had … Read more