This file contains hidden or 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
class Program { | |
public class Db { | |
public static Dictionary<string, DbGeography> Locations = new Dictionary<string, DbGeography>() { | |
//instert the place locations here... | |
}; | |
} |
This file contains hidden or 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
using System; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Data.Common; | |
public static class DbReaderExtensions { | |
public static string SafeGetString(this DbDataReader reader, string columnName) { | |
var index = reader.GetOrdinal(columnName); | |
return !reader.IsDBNull(index) ? reader.GetString(index) : string.Empty; |