我有一个复杂的对象:
ItemName (single only)
Client (single only)
Provider (single only)
Attribute1 (multiple allowed)
Attribute2 (multiple allowed)
Attribute... (multiple allowed)
我有一个 C# 对象:
public class MyJobModel
{
public Dictionary<string,List<string>> JobAttributes { get; set; }
public string ItemName { get; set; }
public string Client { get; set; }
public string DataProvider { get; set; }
public string DataProviderSpecificId { get; set; }
public MyJobModel()
{
JobAttributes = new Dictionary<string, List<string>>();
}
}
我有一个存储库,我可以通过查询查询和填充单个或多个。
我认为创建时不会出现问题,但由于允许的多个同名属性的性质,我在编辑时确实遇到了问题。
有什么建议吗?
最佳答案
我建议您看看 Codeplex 上 Ashley Tate 优秀的“Simol”(以前的“Simple Savant”)库:
关于c# - 如何在复杂的 simpleDb 实体上实现 CRUD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6379208/