Click here to Skip to main content
14,336,453 members
   

C#

 
GeneralRe: My thoughts on C# Pin
#realJSOP2-Jun-19 4:19
mve#realJSOP2-Jun-19 4:19 
GeneralRe: My thoughts on C# Pin
jschell2-Jun-19 8:49
memberjschell2-Jun-19 8:49 
GeneralRe: My thoughts on C# Pin
Brian_TheLion2-Jun-19 19:46
memberBrian_TheLion2-Jun-19 19:46 
GeneralRe: My thoughts on C# Pin
F-ES Sitecore2-Jun-19 23:19
mveF-ES Sitecore2-Jun-19 23:19 
GeneralRe: My thoughts on C# Pin
Brian_TheLion3-Jun-19 12:26
memberBrian_TheLion3-Jun-19 12:26 
GeneralRe: My thoughts on C# Pin
Nathan Minier4-Jun-19 1:31
professionalNathan Minier4-Jun-19 1:31 
GeneralRe: My thoughts on C# Pin
Brian_TheLion4-Jun-19 14:16
memberBrian_TheLion4-Jun-19 14:16 
GeneralRe: My thoughts on C# Pin
Nathan Minier4-Jun-19 14:26
professionalNathan Minier4-Jun-19 14:26 
Yep, that's why I mentioned other tools. I like using MEF for this:
public class MyConfig
{
   [Export("MyValue")]
   public string SharedValue => "This is a value";
}

[Import]
public class MyBusinessObject
{
   [Import("MyValue")]
   public string ConfigValue { get; set; } // Will be initialized to "This is a value" 
}

[Import]
public class MyOtherBusinessObject
{
   [Import("MyValue")]
   public string Value { get; set; } // Will be initialized to "This is a value" 
}

This requires a little bit of bootstrapping to get MEF running, but results in a concise dependency injection mechanism without the bulkiness that some frameworks have.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor

GeneralRe: My thoughts on C# Pin
Brian_TheLion4-Jun-19 14:30
memberBrian_TheLion4-Jun-19 14:30 
GeneralRe: My thoughts on C# Pin
Nathan Minier4-Jun-19 14:40
professionalNathan Minier4-Jun-19 14:40 
GeneralRe: My thoughts on C# Pin
Brian_TheLion4-Jun-19 14:53
memberBrian_TheLion4-Jun-19 14:53 
GeneralRe: My thoughts on C# Pin
Nathan Minier4-Jun-19 14:47
professionalNathan Minier4-Jun-19 14:47 
GeneralRe: My thoughts on C# Pin
Brian_TheLion4-Jun-19 15:12
memberBrian_TheLion4-Jun-19 15:12 
GeneralRe: My thoughts on C# Pin
Nathan Minier4-Jun-19 15:29
professionalNathan Minier4-Jun-19 15:29 
GeneralRe: My thoughts on C# Pin
Brian_TheLion4-Jun-19 16:37
memberBrian_TheLion4-Jun-19 16:37 
GeneralRe: My thoughts on C# Pin
Brian_TheLion4-Jun-19 15:28
memberBrian_TheLion4-Jun-19 15:28 
GeneralRe: My thoughts on C# Pin
Brian_TheLion4-Jun-19 15:38
memberBrian_TheLion4-Jun-19 15:38 
GeneralRe: My thoughts on C# Pin
Nathan Minier4-Jun-19 15:41
professionalNathan Minier4-Jun-19 15:41 
GeneralRe: My thoughts on C# Pin
Gerry Schmitz4-Jun-19 6:53
mveGerry Schmitz4-Jun-19 6:53 
GeneralRe: My thoughts on C# Pin
Brian_TheLion4-Jun-19 18:44
memberBrian_TheLion4-Jun-19 18:44 
QuestionHow to perform the content of a variable as a C# instruction Pin
Member 133074841-Jun-19 10:02
memberMember 133074841-Jun-19 10:02 
AnswerRe: How to perform the content of a variable as a C# instruction Pin
BillWoodruff1-Jun-19 15:33
mveBillWoodruff1-Jun-19 15:33 
GeneralRe: How to perform the content of a variable as a C# instruction Pin
Member 133074841-Jun-19 18:22
memberMember 133074841-Jun-19 18:22 
AnswerRe: How to perform the content of a variable as a C# instruction Pin
jschell2-Jun-19 8:53
memberjschell2-Jun-19 8:53 
QuestionHow To Make This Generic Pin
Kevin Marois31-May-19 11:55
professionalKevin Marois31-May-19 11:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.