特定のレシピ(すべての材料)のすべての数量を単一の値に合計して、合計数量を取得する方法を見つけようとしています
次のデータセットがあると仮定します。
RecipeName IngredientName ReceiptWeight
Food1 Ingredient1 5
Food1 Ingredient2 2
Food2 Ingredient1 12
Food2 Ingredient3 1
そして、私は次のことを期待しています:
RecipeName ReceiptWeight
Food1 7
Food2 13
私がこれまでに持っているコードは次のとおりです。
Grouping =
(
from data in dataset
group data by data.RecipeName into recipeGroup
let fullIngredientGroups = recipeGroup.GroupBy(x => x.IngredientName)
select new ViewFullRecipe()
{
RecipeName = recipeGroup.Key,
ReceiptWeight = ????
RecipeWeight の値を取得するにはどうすればよいですか? ありがとう、