PetaPoco的合適方式是如何合成一個集合的POCO屬性?我想要做這樣的事情,但不知道如何。PetaPoco收集合適的物品
return db.Fetch<ColorCategory, List<SubColor>, ColorCategory>((c, s) => { c.SubColors = *?*; return c; }, "SELECT [ColorCategory].[ColorCategoryID] " +
",[ColorCategory].[DisplayOrder] " +
",[ColorCategory].[Name] " +
",[ColorCategory].[ModifiedDate] " +
",[ColorCategory].[ModifiedUser] " +
",[SubColor].[SubColorID] " +
",[SubColor].[Name] " +
"FROM [ColorCategory] " +
"INNER JOIN [ColorCategorySubColor] ON [ColorCategory].[ColorCategoryID] = [ColorCategorySubColor].[ColorCategoryID] " +
"INNER JOIN [SubColor] ON [ColorCategorySubColor].[SubColorID] = [SubColor].[SubColorID]");
其中ColorCategory類具有List屬性SubColors。
我確實必須創建relator類,一旦我明白了它的工作原理,它就非常簡單。謝謝! – RobertMGlynn