Created
February 12, 2014 13:01
-
-
Save yemrekeskin/8955174 to your computer and use it in GitHub Desktop.
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
// 1 Way | |
public class Configuration | |
{ | |
public string EndPoint | |
{ | |
get { return ConfigurationManager.AppSettings["EndPoint"]; } | |
} | |
// other properties here// | |
} | |
// 2 WAy | |
public interface IConfiguration | |
{ | |
string EndPoint { get; } | |
} | |
public class Configuration | |
: IConfiguration | |
{ | |
public string EndPoint | |
{ | |
get { return ConfigurationManager.AppSettings["EndPoint"]; } | |
} | |
// other properties here// | |
} | |
// 3 Way | |
public class Configuration | |
{ | |
public string EndPoint { get; set; } | |
// other properties here// | |
} | |
public class ConfigurationLoader | |
{ | |
public Configuration Load() | |
{ | |
return new Configuration | |
{ | |
EndPoint = ConfigurationManager.AppSettings["EndPoint"] | |
// other properties here// | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment