我正在尝试将特定配方(所有成分)的所有数量求和为单个值以获得总数量
假设我有以下数据集:
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 的值?谢谢,