一.概述 ODATA不经可以作为WebAPI建立相应的WEBAPI控制器,还可以建立ODataControl控制器,能够通过插件建立第三方ODataClinet类库:调用和使用数据变得简单可行. 二.建立OData Web API 服务端 1.通过NuGet添加第三方Microsoft.AspNet.OData: 2.建立相应的Model:Person和Trip using System; using System.Collections.Generic; using System.Compon…
程序数据库格式标准化的开源数据协议 为了增强各种网页应用程序之间的数据兼容性,微软公司启动了一项旨在推广网页程序数据库格式标准化的开源数据协议(OData)计划,于此同时,他们还发 布了一款适用于OData协议的开发工具,以方便网页程序开发者们使用. Open Data Protocol (开放数据协议,OData)是用来查询和更新数据的一种Web协议,其提供了把存在于应用程序中的数据暴露出来的方式.OData运用且构建于很多 Web技术之上,比如HTTP.Atom Publishing Pro…
http://www.cnblogs.com/shanyou/archive/2013/06/11/3131583.html 在SOA的世界中,最重要的一个概念就是契约(contract).在云计算的世界中,有关通信的最重要的概念也是契约.XML具有强大对数据的描述能力,Atom格式和AtomPub都建立在XML之上,在Google和微软的推动下,也已经成为标准.但是,Atom/AtomPub和ODBC/OLEDB这样的真正数据交互协议相比较,还有着根本上的欠缺:缺乏数据类型的具体描述,降低了交…
本篇体验实现ASP.NET Web API基于OData的增删改查,以及处理实体间的关系. 首先是比较典型的一对多关系,Supplier和Product. public class Product { public int Id { get; set; } public string Name { get; set; } public decimal Price { get; set; } public string Category { get; set; } [ForeignKey("Sup…
本文转自:http://www.cnblogs.com/darrenji/p/4926334.html 本篇体验实现ASP.NET Web API基于OData的增删改查,以及处理实体间的关系. 首先是比较典型的一对多关系,Supplier和Product. public class Product { public int Id { get; set; } public string Name { get; set; } public decimal Price { get; set; } p…
本文转自:https://www.pluralsight.com/blog/tutorials/asp-net-web-api-2-odata-enhancements Along with the release of Visual Studio 2013 came a new release of ASP.NET MVC (called MVC 5) and ASP.NET Web API (called Web API 2). Part of the enhancements to the…
ASP.NET Web API和WCF都体现了REST软件架构风格.在REST中,把一切数据视为资源,所以也是一种面向资源的架构风格.所有的资源都可以通过URI来唯一标识,通过对资源的HTTP操作(GET/HEAD.POST.PUT和DELETE),使资源的表征状态发生了改变,即Representational State Transfer,缩写为REST. WCF从3.5以来,也体现了REST的架构风格,但对于一般的消息通信来说,显得"过重",所以,微软推出ASP.NET Web A…
一.概述 时间也算充足,抽点时间总结下OData的常用的使用方式,开放数据协议(OData)是一个查询和更新数据的Web协议.OData应用了web技术如HTTP.Atom发布协议(AtomPub)和JSON等来提供对不同应用程序,服务和存储的信息访问.除了提供一些基本的操作(像增删改查),也提供了一些高级的操作类似过滤数据和实体的导航.OData扩展了上述的协议但是不是取代他们.他可以被XML(ATOM)或者JSON取代但是OData的重要在于它符合REST原则.在某种意义上,它建立在'简单'…
Creating a REST service using ASP.NET Web API A service that is created based upon the architecture of REST is called as REST service. Although REST looks more inclined to web and HTTP its principles can be applied to other distributed communication…
本文转自:https://docs.microsoft.com/en-us/aspnet/web-api/overview/odata-support-in-aspnet-web-api/using-select-expand-and-value by Mike Wasson+ Web API 2 adds support for the $expand, $select, and $value options in OData. These options allow a client to…