简体   繁体   English

实体框架是否对表队列有类似sql OUTPUT子句的内容?

[英]Does the Entity framework have anything like the sql OUTPUT clause for table queues?

I'm looking to create a queue that will be accessed by a multithreaded application. 我正在寻找一个将由多线程应用程序访问的队列。 I've seen a few SO questions on this topic and suggest using tables and reference this article that suggests using the sql OUTPUT clause the does a read and delete in the same data call. 我看到关于这一主题的几个做题和使用表格和参考建议这个文章是建议使用SQL输出子句不读,并在同一个数据呼叫删除。 This prevents multiple threads reading the same record. 这样可以防止多个线程读取同一条记录。

I'm my case I'm using the entity framework and was wondering if anyone knows of a way to achieve the same results with the entity framework. 我的情况是我正在使用实体框架,并且想知道是否有人知道使用实体框架实现相同结果的方法。 Thanks in advance! 提前致谢!

The article that you linked to creates stored procedures. 您链接到的文章将创建存储过程。 EF supports stored procedures, so you can just call the stored procedures from EF. EF支持存储过程,因此您只需从EF调用存储过程即可。

EF also supports commands, so you could put the SQL in a command text and execute it. EF还支持命令,因此您可以将SQL放在命令文本中并执行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 实体框架和SQL Server OUTPUT子句 - Entity Framework and SQL Server OUTPUT clause 实体框架-> Execute和LIKE子句 - Entity Framework -> Execute and LIKE clause 在Python中,将SQL查询的输出显示为表格,就像在SQL中一样 - In Python, display output of SQL query as a table, just like it does in SQL 实体框架6投影生成等效于“ Select *”的SQL,并且不生成WHERE子句 - Entity framework 6 projection generates SQL equivalent to “Select *” and does not produce WHERE clause 具有Have子句的内部联接不提供输出 - Inner joins with have clause does not give output 实体框架不获取具有关系的行 - Entity Framework does not fetch the rows that have a relationship 将SQL查询转换为使用AggregateFunctions和Where子句的实体框架 - Convert SQL query to Entity Framework which used AggregateFunctions and Where clause 在ADO.NET实体框架上,DbContext对象没有表字段 - On ADO.NET entity framework, the DbContext object does not have a table field 在 Entity Framework Core 中为没有显式外键的表添加自定义导航属性 - Adding custom navigation property in Entity Framework Core for table that does not have an explicit foreign key 使用实体框架时规范化SQL表 - Normalizing SQL table while using Entity Framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM