简体   繁体   English

如何在原型文件中定义IQueryable

[英]How can I define IQueryable in proto file

I have 我有

public System.Linq.IQueryable<Models.MyDbModel.ACTION> Get()
{
}

public System.Web.Http.IHttpActionResult Put(int id, 
Models.MyDbModel.ACTION ACTION)
{
}

and I need to define it in my proto file 我需要在原始文件中定义它

IQueryable[<T>] is a very complex API that expresses deferred queries as an AST (expression tree). IQueryable[<T>]是一个非常复杂的API,将延迟的查询表示为AST(表达式树)。 It certainly isn't going work in the general case of gRPC; 在gRPC的一般情况下,它肯定行不通; it could potentially be expressed in a very specific implementation in a .NET-only way, but it would require someone to write all the code relating to serializing and deserializing the AST, and AFAIK that hasn't happened to date . 可能会以仅.NET的方式在非常特定的实现中表达,但是它需要有人编写与AST和AFAIK 迄今为止尚未发生的序列化和反序列化有关的所有代码。 So: today I would say: don't do that. 所以: 今天我会说:不要那样做。 Write a query in a regular .proto way. 以常规.proto方式编写查询。 If you want a particular library (such as protobuf-net) to consider implementing the AST version, then that is something to discuss on that library's repo. 如果您希望特定的库(例如protobuf-net)考虑实现AST版本,则需要在该库的存储库中进行讨论。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM