产品和股票LINQ查询帮助 [英] Product and Stocks LINQ query help
问题描述
我在我的项目中使用EF6。
我需要实体,产品和股票。
产品实体包含我们管理的产品,而股票包含我们分支机构管理的产品(库存)数量。
我需要一个LINQ查询加入两个实体并计算(总和)每个产品的总数量(属性)库存。
谢谢,
Benjie
Benjamin Fallar III
我假设您知道如何使用T-TSQL
http://www.dotnettricks.com/learn/linq/sql-joins-with-csharp-linq
你可以玩和解决。
你在谈论Linq 101这里的东西,你应该能够自己解决,比如Sum()聚合,也许得到一个关于Linq的好书。
I'm using EF6 in my project.
I have to entities, Product, and Stocks.
Product entity contains the product that we manage, and Stocks contains the number of products (stocks) that each our branches managed.
I need a LINQ query to join the two entities and calculate (sum) the total quantity (property) stock of each product.
Thanks,
Benjie
Benjamin Fallar III
I'll assume that you know how to use T-TSQL
http://www.dotnettricks.com/learn/linq/sql-joins-with-csharp-linq
You can play and figure it out.
You are talking Linq 101 stuff here that you should be able to figure out on your own, like the Sum() aggregate and maybe get a good book on Linq.
这篇关于产品和股票LINQ查询帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!