产品和股票LINQ查询帮助 [英] Product and Stocks LINQ query help

查看:63
本文介绍了产品和股票LINQ查询帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用EF6。


我需要实体,产品和股票。


产品实体包含我们管理的产品,而股票包含我们分支机构管理的产品(库存)数量。


我需要一个LINQ查询加入两个实体并计算(总和)每个产品的总数量(属性)库存。


谢谢,


Benjie




Benjamin Fallar III

解决方案

我假设您知道如何使用T-TSQL


http://www.dotnettricks.com/learn/linq/sql-joins-with-csharp-linq


你可以玩和解决。


https:// www.linqpad.net/


你在谈论Linq 101这里的东西,你应该能够自己解决,比如Sum()聚合,也许得到一个关于Linq的好书。


https://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b


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.

https://www.linqpad.net/

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.

https://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b


这篇关于产品和股票LINQ查询帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆