DbGeography mapping in OnModelCreating RRS feed

  • Question

  • Hi

    I have a class with properties Latitude and Longitude. I use EF 5 for persistence so DbGeography is a good choice, but I don't want that my entity class library has reference with EF.

    Is it possible to map into OnModelCreating this rule so that db table has DbGeography while into my class remain Lat and Lon ? With fluent api I mean.

    In case of true , when I call get method of my repository , the inverse mapping ( from DBGeo to Lat and Lon) is automatic ?

    Thanks in advance


    Thursday, March 14, 2013 3:20 PM


All replies