This is a fody add-in that helps transfering Dictionary<string,object> type of data structures into C# properties.
The reason for this i to have a Dictionary a like repository with strongly typed content.
In order to have intellisense support it is advised to leave repositories in a separate project.
------------------------------------------------------------------------------------------------------------
Classes need to implement ISeedSource interface:
public interface ISeedSource
{
object GetKeyValue(string key);
void SetKeyValue(string key,object value);
IDictionary<string, object> Data {get;}
}
public class SeedRepository : ISeedSource
{
private ExpandoObject expando = new ExpandoObject();
public object GetKeyValue(string key)
{
return Data[key];
}
public void SetKeyValue(string key,object value)
{
Data[key] = value;
}
public SeedRepository()
{
var expandoDict = Expando as IDictionary<String, Object>;
expandoDict.Add(new KeyValuePair<string, object> ("Perestroika", "HasThisPayload"));
}
}
------------------------------------------------------------------------------------------------------------
var repository = new SeedRepository();
var pereContent = repository.Perestroika; // <----- dictionary key is now a property
A Nuget Fody plugin for converting dictionary members into class level properties
License
MIT, MIT licenses found
Licenses found
MIT
LICENSE
MIT
license.txt
qkub/ExpandoIntelligizer
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A Nuget Fody plugin for converting dictionary members into class level properties
Resources
License
MIT, MIT licenses found
Licenses found
MIT
LICENSE
MIT
license.txt
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published