{"id":299108,"date":"2020-02-22T21:00:10","date_gmt":"2020-02-22T21:00:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=299108"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=299108","title":{"rendered":"\u0422\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b OData \u0432 TypeScript"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/489122\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_r\/xa\/z6\/_rxaz6gbce_xm4yazomsaczakpw.png\"><\/p>\n<p>  <\/p>\n<p>\u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b OData \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u043b\u0438 \u0431\u0435\u0437 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 IntelliSense, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044f\u0437\u044b\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 TsToOdata, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u044f\u0437\u044b\u043a\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u0430\u043c \u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c. \u0412\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0441\u0442\u0440\u043e\u0433\u043e \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u044f\u0437\u044b\u043a\u0430 TypeScript \u0438 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>TsToOdata \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f TypeScript. \u041e\u043d\u0430 \u044f\u0432\u043b\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0431\u0438\u0435\u043c LINQ \u0434\u043b\u044f C#, \u043d\u043e, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 OData. \u0414\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e TsToOdata \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0438\u0448\u0435\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e, \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u0445\u043e\u0434\u044f\u0441\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h4 id=\"sozdanie-modeli-dannyh\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b OData \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u044b TypeScript.<br \/>  \u041f\u0435\u0440\u0432\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 EDMX Json \u0441\u0445\u0435\u043c\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/voronov-maxim\/OdataToEntity\/wiki\/Json-schema\" rel=\"nofollow\">OdataToEntity<\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">IEdmModel edmModel; using (var reader = XmlReader.Create(&quot;edmx_schema.xml&quot;))     edmModel = CsdlReader.Parse(reader);  var generator = new OeJsonSchemaGenerator(edmModel); using (var utf8Json = new MemoryStream()) {     generator.Generate(utf8Json);     utf8Json.Position = 0;     File.WriteAllBytes(&quot;json_schema.json&quot;, utf8Json.ToArray()); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u044b\u043c \u0430\u0448\u0433\u043e\u043c \u0438\u0437 Json \u0441\u0445\u0435\u043c\u044b \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 TypeScript. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/quicktype\/quicktype\" rel=\"nofollow\">quicktype<\/a>.<br \/>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c <a href=\"https:\/\/raw.githubusercontent.com\/voronov-maxim\/TsToOdata\/master\/test\/order.ts\" rel=\"nofollow\">\u0441\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/a> \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445.<\/p>\n<p>  <\/p>\n<h4 id=\"ustanovka-tstoodata\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 TsToOdata<\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">npm install ts2odata<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"sozdanie-konteksta-dostupa-k-dannym\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c<\/h4>\n<p>  <\/p>\n<pre><code class=\"javascript\">import { EntitySet, OdataContext } from 'ts2odata'; import * as oe from '.\/order';  export class OrderContext extends OdataContext&lt;OrderContext&gt; {     Categories = EntitySet.default&lt;oe.Category&gt;();     Customers = EntitySet.default&lt;oe.Customer&gt;();     OrderItems = EntitySet.default&lt;oe.OrderItem&gt;();     OrderItemsView = EntitySet.default&lt;oe.OrderItemsView&gt;();     Orders = EntitySet.default&lt;oe.Order&gt;(); }<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">let context: OrderContext = OdataContext.create(OrderContext, 'http:\/\/localhost:5000\/api');<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"primery-zaprosov\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/h4>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders; \/\/http:\/\/localhost:5000\/api\/Orders<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.select(o =&gt; { return { p: o.Name } }); \/\/http:\/\/localhost:5000\/api\/Orders?$select=Name<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.orderby(i =&gt; i.Id); \/\/http:\/\/localhost:5000\/api\/Orders?$orderby=Id<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.orderbyDescending(i =&gt; i.Id); \/\/http:\/\/localhost:5000\/api\/Orders?$orderby=Id desc<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.filter(o =&gt; o.Date.getFullYear() == 2016); \/\/http:\/\/localhost:5000\/api\/Orders?$filter=year(Date) eq 2016<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.expand(o =&gt; o.Items); \/\/http:\/\/localhost:5000\/api\/Orders?$expand=Items<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u0435\u0439<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Customers..expand(c =&gt; c.Orders).thenExpand(o =&gt; o.Items); \/\/http:\/\/localhost:5000\/api\/Customers?$expand=Orders($expand=Items)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.orderby(i =&gt; i.Id).skip(2); \/\/http:\/\/localhost:5000\/api\/Orders?$orderby=Id&amp;$skip=2<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0437\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.orderby(i =&gt; i.Id).top(3); \/\/http:\/\/localhost:5000\/api\/Orders?$orderby=Id&amp;$top=3<\/code><\/pre>\n<p>  <\/p>\n<p>\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.OrderItems.groupby(i =&gt; { return { Product: i.Product } }); \/\/localhost:5000\/api\/OrderItems?$apply=groupby((Product))<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.OrderItems.groupby(i =&gt; { return { OrderId: i.OrderId, Status: i.Order.Status } })     .select(g =&gt; {         return {             orderId: g.key.OrderId,             avg: g.average(i =&gt; i.Price),             dcnt: g.countdistinct(i =&gt; i.Product),             max: g.max(i =&gt; i.Price),             max_status: g.max(_ =&gt; g.key.Status),             min: g.min(i =&gt; i.Price),             sum: g.sum(i =&gt; i.Price),             cnt: g.count()         }}); \/\/http:\/\/localhost:5000\/api\/OrderItems?$apply=groupby((OrderId,Order\/Status),aggregate(Price with average as avg,Product with countdistinct as dcnt,Price with max as max,Order\/Status with max as max_status,Price with min as min,Price with sum as sum,$count as cnt))<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e \u043a\u043b\u044e\u0447\u0443<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Customers.key({ Country: 'RU', Id: 1 }); \/\/http:\/\/localhost:5000\/api\/Customers(Country='RU',Id=1)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.OrderItems.key(1, i =&gt; i.Order.Customer); \/\/http:\/\/localhost:5000\/api\/OrderItems(1)\/Order\/Customer<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0447\u0435\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.OrderItems     .select(i =&gt; {         return {             product: i.Product,             Total: i.Count * i.Price,             SumId: i.Id + i.OrderId         }     }); \/\/http:\/\/localhost:5000\/api\/OrderItems?$select=Product&amp;$compute=Count mul Price as Total,Id add OrderId as SumId<\/code><\/pre>\n<p>  <\/p>\n<p>\u041b\u044f\u043c\u0431\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.filter(o =&gt; o.Items.every(i =&gt; i.Price &gt;= 2.1)); \/\/http:\/\/localhost:5000\/api\/Orders?$filter=Items\/all(d:d\/Price ge 2.1)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.filter(o =&gt; o.Items.some(i =&gt; i.Count &gt; 2)); \/\/http:\/\/localhost:5000\/api\/Orders?$filter=Items\/any(d:d\/Count gt 2)<\/code><\/pre>\n<p>  <\/p>\n<p>IN \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">let items = [1.1, 1.2, 1.3]; context.OrderItems.filter(i =&gt; items.includes(i.Price), { items: items }); \/\/http:\/\/localhost:5000\/api\/OrderItems?$filter=Price in (1.1,1.2,1.3)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.count(); \/\/http:\/\/localhost:5000\/api\/Orders\/$count<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<br \/>  \u041c\u0435\u0442\u043e\u0434 <em>asEntitySet<\/em> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0432 \u0432\u044b\u0431\u043e\u0440\u043a\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders(o =&gt; o.AltCustomer).thenSelect(o =&gt; {{     p1: o.Address,     : o.Country,     : o.Id,     : o.Name,     : o.Sex }}).asEntitySet().orderby(o =&gt; o.Id) \/\/http:\/\/localhost:5000\/api\/Orders?$expand=AltCustomer($select=Address,Country,Id,Name,Sex)&amp;$orderby=Id<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/voronov-maxim\/TsToOdata\/blob\/master\/test\/QueryTests.ts\" rel=\"nofollow\">GitHub<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u044b <em>select<\/em>, <em>expand<\/em>, <em>groupby<\/em> \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u2014 \u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u2014 \u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u043e\u0439 <em>then<\/em>: <em>thenFilter<\/em>, <em>thenExpand<\/em>, <em>thenOrderby<\/em>, <em>thenOrderbyDescending<\/em>, <em>thenSkip<\/em>, <em>thenTop<\/em>. \u041c\u0435\u0442\u043e\u0434\u044b <em>select<\/em> \u0438 <em>thenSelect<\/em> \u043d\u0435\u043e\u0431\u0440\u0430\u0442\u0438\u043c\u043e \u043c\u0435\u043d\u044f\u044e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0438, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>asEntitySet<\/em>.<\/p>\n<p>  <\/p>\n<h4 id=\"parametrizaciya-zaprosov\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/h4>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u2014 <em>filter<\/em>, \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u2014 <em>select<\/em>, \u0433\u0440\u0443\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u2014 <em>groupby<\/em> \u043c\u043e\u0436\u043d\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438\u043c\u0435\u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0434\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">let count: number | null = null; context.OrderItems.filter(i =&gt; i.Count == count, { count: count }); \/\/http:\/\/localhost:5000\/api\/OrderItems?$filter=Count eq null<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">let s = {     altCustomerId: 3,     customerId: 4,     dateYear: 2016,     dateMonth: 11,     dateDay: 20,     date: null,     name: 'unknown',     status: &quot;OdataToEntity.Test.Model.OrderStatus'Unknown'&quot;,     count1: 0,     count2: null,     price1: 0,     price2: null,     product1: 'unknown',     product2: 'null',     orderId: -1,     id: 1 }; context.Orders.filter(o =&gt; o.AltCustomerId == s.altCustomerId &amp;&amp; o.CustomerId == s.customerId &amp;&amp; (o.Date.getFullYear() == s.dateYear &amp;&amp; o.Date.getMonth() &gt; s.dateMonth &amp;&amp; o.Date.getDay() &lt; s.dateDay || o.Date == s.date) &amp;&amp; o.Name.includes(s.name) &amp;&amp; o.Status == s.status, s).expand(o =&gt; o.Items).thenFilter(i =&gt; (i.Count == s.count1 || i.Count == s.count2) &amp;&amp; (i.Price == s.price1 || i.Price == s.price2) &amp;&amp; (i.Product.includes(s.product1) || i.Product.includes(s.product2)) &amp;&amp; i.OrderId &gt; s.orderId &amp;&amp; i.Id != s.id, s); \/\/http:\/\/localhost:5000\/api\/Orders?$filter=AltCustomerId eq 3 and CustomerId eq 4 and (year(Date) eq 2016 and month(Date) gt 11 and day(Date) lt 20 or Date eq null) and contains(Name,'unknown') and Status eq OdataToEntity.Test.Model.OrderStatus'Unknown'&amp;$expand=Items($filter=(Count eq 0 or Count eq null) and (Price eq 0 or Price eq null) and (contains(Product,'unknown') or contains(Product,'null')) and OrderId gt -1 and Id ne 1)<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"otobrazhenie-funkciy\">\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/h4>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>JavaScript<\/th>\n<th>OData<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Math.ceil<\/td>\n<td>ceiling<\/td>\n<\/tr>\n<tr>\n<td>concat<\/td>\n<td>concat<\/td>\n<\/tr>\n<tr>\n<td>includes<\/td>\n<td>contains<\/td>\n<\/tr>\n<tr>\n<td>getDay<\/td>\n<td>day<\/td>\n<\/tr>\n<tr>\n<td>endsWith<\/td>\n<td>endswith<\/td>\n<\/tr>\n<tr>\n<td>Math.floor<\/td>\n<td>floor<\/td>\n<\/tr>\n<tr>\n<td>getHours<\/td>\n<td>hour<\/td>\n<\/tr>\n<tr>\n<td>indexOf<\/td>\n<td>indexof<\/td>\n<\/tr>\n<tr>\n<td>stringLength<\/td>\n<td>length<\/td>\n<\/tr>\n<tr>\n<td>getMinutes<\/td>\n<td>minute<\/td>\n<\/tr>\n<tr>\n<td>getMonth<\/td>\n<td>month<\/td>\n<\/tr>\n<tr>\n<td>Math.round<\/td>\n<td>round<\/td>\n<\/tr>\n<tr>\n<td>getSeconds<\/td>\n<td>second<\/td>\n<\/tr>\n<tr>\n<td>startsWith<\/td>\n<td>startswith<\/td>\n<\/tr>\n<tr>\n<td>substring<\/td>\n<td>substring<\/td>\n<\/tr>\n<tr>\n<td>toLowerCase<\/td>\n<td>tolower<\/td>\n<\/tr>\n<tr>\n<td>toUpperCase<\/td>\n<td>toupper<\/td>\n<\/tr>\n<tr>\n<td>trim<\/td>\n<td>trim<\/td>\n<\/tr>\n<tr>\n<td>getFullYear<\/td>\n<td>year<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>OdataFunctions.stringLength<\/em><\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Customers.filter(c =&gt; OdataFunctions.stringLength(c.Name) == 5); \/\/http:\/\/localhost:5000\/api\/Customers?$filter=length(Name) eq 5<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0434\u043b\u0438\u043d\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>OdataFunctions.arrayLength<\/em><\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Orders.filter(o =&gt; OdataFunctions.arrayLength(o.Items) &gt; 2); \/\/http:\/\/localhost:5000\/api\/Customers?$filter=Items\/$count gt 2<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"poluchenie-rezultatov\">\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432<\/h4>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a select, filter \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <em>getQueryUrl<\/em> \u0438\u043b\u0438 <em>toArrayAsync<\/em>.<br \/>  <em>getQueryUrl<\/em> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 URL \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 TypeScript:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">let url: URL = context.Customers     .expand(c =&gt; c.AltOrders).thenExpand(o =&gt; o.Items).thenOrderby(i =&gt; i.Price)     .expand(c =&gt; c.AltOrders).thenExpand(o =&gt; o.ShippingAddresses).thenOrderby(s =&gt; s.Id)     .expand(c =&gt; c.Orders).thenExpand(o =&gt; o.Items).thenOrderby(i =&gt; i.Price)     .expand(c =&gt; c.Orders).thenExpand(o =&gt; o.ShippingAddresses).thenOrderby(s =&gt; s.Id)     .orderby(c =&gt; c.Country).orderby(c =&gt; c.Id).getQueryUrl();<\/code><\/pre>\n<p>  <\/p>\n<p>\u0431\u0443\u0434\u0435\u0442 OData \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">http:\/\/localhost:5000\/api\/Customers?$expand= AltOrders($expand=Items($orderby=Price),ShippingAddresses($orderby=Id)), Orders($expand=Items($orderby=Price),ShippingAddresses($orderby=Id)) &amp;$orderby=Country,Id<\/code><\/pre>\n<p>  <\/p>\n<p><em>toArrayAsync<\/em> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0432\u0438\u0434\u0435 Json. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 TypeScript:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">context.Customers     .expand(c =&gt; c.Orders).thenSelect(o =&gt; { return { Date: o.Date } }).orderby(o =&gt; o.Date)     .asEntitySet().select(c =&gt; { return { Name: c.Name } }).orderby(c =&gt; c.Name).toArrayAsync();<\/code><\/pre>\n<p>  <\/p>\n<p>\u0431\u0443\u0434\u0435\u0442 Json:<\/p>\n<p>  <\/p>\n<pre><code class=\"json\">[{         &quot;Name&quot;: &quot;Ivan&quot;,         &quot;Orders&quot;: [{                 &quot;Date&quot;: &quot;2016-07-04T19:10:10.8237573+03:00&quot;             }, {                 &quot;Date&quot;: &quot;2020-02-20T20:20:20.000002+03:00&quot;             }         ]     }, {         &quot;Name&quot;: &quot;Natasha&quot;,         &quot;Orders&quot;: [{                 &quot;Date&quot;: &quot;2016-07-04T19:10:11+03:00&quot;             }         ]     }, {         &quot;Name&quot;: &quot;Sasha&quot;,         &quot;Orders&quot;: []     }, {         &quot;Name&quot;: &quot;Unknown&quot;,         &quot;Orders&quot;: [{                 &quot;Date&quot;: null             }         ]     } ]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u0430\u043a \u0434\u0430\u0442\u0443, \u0430 \u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <em>toArrayAsync<\/em> \u0441 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <em>OdataParser<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import { OdataParser } from 'ts2odata'; import schema from '.\/schema.json';  let odataParser = new OdataParser(schema); context.Orders.toArrayAsync(odataParser);<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"tipy-perechisleniy-enum\">\u0422\u0438\u043f\u044b \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 (enum)<\/h4>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u0448 OData \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d (Namespace), \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">let context: OrderContext = OdataContext.create(OrderContext, 'http:\/\/localhost:5000\/api', 'OdataToEntity.Test.Model');<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>OdataParser<\/em>.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import { OdataParser } from 'ts2odata'; import schema from '.\/schema.json';  let odataParser = new OdataParser(schema); let context: OrderContext = OdataContext.create(OrderContext, 'http:\/\/localhost:5000\/api', 'OdataToEntity.Test.Model', odataParser);<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"ishodnyy-kod\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/h4>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043b\u0435\u0436\u0438\u0442 \u043d\u0430 <a href=\"https:\/\/github.com\/voronov-maxim\/TsToOdata\" rel=\"nofollow\">GitHub<\/a>.<br \/>  \u0412 \u043f\u0430\u043f\u043a\u0435 source \u2014 \u043a\u043e\u0434 Node \u043f\u0430\u043a\u0435\u0442\u0430, \u0432 \u043f\u0430\u043f\u043a\u0435 test \u2014 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>  <\/p>\n<p>\u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043c\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 TsToOdata \u0431\u0443\u0434\u0435\u0442 \u0412\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0438 \u0438\u0437\u0431\u0430\u0432\u0438\u0442 \u0412\u0430\u0441 \u043e\u0442 \u0440\u0443\u0442\u0438\u043d\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/489122\/\"> https:\/\/habr.com\/ru\/post\/489122\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/489122\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_r\/xa\/z6\/_rxaz6gbce_xm4yazomsaczakpw.png\"><\/p>\n<p>  <\/p>\n<p>\u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b OData \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u043b\u0438 \u0431\u0435\u0437 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 IntelliSense, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044f\u0437\u044b\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 TsToOdata, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u044f\u0437\u044b\u043a\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u0430\u043c \u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c. \u0412\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0441\u0442\u0440\u043e\u0433\u043e \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u044f\u0437\u044b\u043a\u0430 TypeScript \u0438 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-299108","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=299108"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299108\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}