Last active
August 29, 2015 14:25
-
-
Save edrohler/e11489647b3685e5be8b to your computer and use it in GitHub Desktop.
Entity Framework Migrations Computed Column for DbGeography Location, Tme and Cost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sql("ALTER TABLE dbo.Profile ADD DisplayName AS FirstName + ' ' + LastName"); | |
Sql("ALTER TABLE dbo.Profile ADD LastNameFirst AS LastName + ', ' + FirstName"); | |
Sql("ALTER TABLE dbo.Profile ADD PublicName AS FirstName + ' ' + SUBSTRING(LastName, 1, 1) + '.'"); | |
Sql("ALTER TABLE dbo.Availability ADD TotalHours AS DATEDIFF(SECOND,BeginTime,Endtime)/3600"); | |
Sql("ALTER TABLE dbo.Rate ADD EstWeeklyRateLow AS HourlyRateLow*DesiredWeeklyHours"); | |
Sql("ALTER TABLE dbo.Rate ADD EstWeeklyRateHigh AS HourlyRateHigh*DesiredWeeklyHours"); | |
Sql("ALTER TABLE dbo.LocationData ADD Location AS geography::Point(Latitude,Longitude, 4326)"); | |
Sql("ALTER TABLE dbo.RefZipCode ADD Location AS geography::Point(Latitude,Longitude, 4326)"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment