odata

How do i patch enumerables with Odata.Delta with Webapi

烂漫一生 提交于 2019-12-11 15:03:32
问题 I´m trying to use System.Web.Http.OData.Delta to implement PATCH methods in ASP.NET Web API services, but it seems unable to apply changes to properties of type IEnumerable. This is my code: public class Person { [Required] public string Name { get; set; } public IList<Document> AdditionalDocuments { get; set; } public HomeAddress HomeAddress { get; set; } } public class HomeAddress { public string StreetName { get; set; } } public class Document { public string Value { get; set; } } The

unable to locate property: Nome on entityType:

痴心易碎 提交于 2019-12-11 14:14:58
问题 Problem unable to locate property: Nome on entityType: Modalidade:#CreditoImobiliarioBB.Model But this property is in the class! No request for /odata/modalidades is generated, only a request for /odata/$metadata . Code Domain class public class Modalidade : INamedEntity { public int Id { get; set; } [StringLength(80), Required] public string Nome { get; set; } } Configurations public static class WebApiConfig { public static void Register(HttpConfiguration config) { var modelBuilder = new

How to create / where the batch endpoint is for an asp.net OData webservice

不羁的心 提交于 2019-12-11 13:53:36
问题 I have been going through the tutorials at http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api to create an OData webservice. I have my service set up as follows: var modelBuilder = new ODataConventionModelBuilder(); modelBuilder.EntitySet<Analytic>("Analytics"); var edmModel = modelBuilder.GetEdmModel(); config.Routes.MapODataRoute( routeName: "Odata", routePrefix: "odata", model: edmModel); I can issue a get request to http://localhost:49255/odata/Analytics then the

Breeze working with Web API OData

我怕爱的太早我们不能终老 提交于 2019-12-11 13:35:38
问题 I have a .NET WebAPI 2 Odata service and i am working with Breeze on top of it The OData service is based on the VS2013 ASP.Net VNext version The service supports expand I managed to trick the Microsoft OData metadata serialize to provide the referential constraint with the foreign key like so: <edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0"> <edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="3

$Search not working in odata web api 2

三世轮回 提交于 2019-12-11 13:13:53
问题 I am unable to determine how to get $search parameter to work for full text search in odata. The following url indicates that it should be included in 6.1 http://blogs.msdn.com/b/odatateam/archive/2014/03/21/odata-6-1-and-odata-client-6-1-are-now-shipped.aspx I have created a sample application using the following template http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-v4/create-an-odata-v4-endpoint When I execute the odata query http://localhost:53621/odata

OData - Strange index with MongoDB [Mongoose: Cast Error]

早过忘川 提交于 2019-12-11 12:45:35
问题 I have some MongoDB documents with this schema: Id: {type: "id", key: true, computed: true, nullable: false}, Name: {type: "string", nullable: false, maxLength: 50} and these documents are exposed as OData by a small web application (I'm using Express, JayData, and Mongoose). These are some of those documents: { "_id" : ObjectId("5343fd656b9c5c084b8f2a70"), "Name" : "Service74"}, { "_id" : ObjectId("5343fd656b9c5c084b8f2a6f"), "Name" : "Service73"}, { "_id" : ObjectId(

Odata web api 404 error

喜欢而已 提交于 2019-12-11 12:38:05
问题 I am new to odata. I have builded a web api with a controller as shown below: using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Web.OData.Routing; namespace HelloWebApi.Controllers { public class TestsController : ODataController { // // GET: /Product/ ProductsContext db = new ProductsContext(); private bool TestExists(int key) { return db.tests.Any(p => p.key== key); } protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); }

ODATA:GetEntity和GetEntitySet方法基本实现

假装没事ソ 提交于 2019-12-11 12:26:08
一、为后续demo搭建简单的基础信息:一个Odata服务ZDEMO_PO,三个数据库表及模型ZPOHEADER、ZPOITEM、ZVENDOR,相应的Association,后续文章基本使用ZDEMO_PO项目 创建项目 创建相应的entity 创建entity的属性,我这里手工创建,实际可以通过导入数据库表的方式来创建 同理创建POTIEM和VENDOR 创建抬头和明细的association 生产运行对象: 参考上篇文章 ODATA:基于搜索帮助创建一个ODATA服务 生成相应的服务 自此还不能获取相关数据,需要实现相关方法,否则报如下错误 二、实现POHEADER的GetEntitySet方法 会发现会跳转到类ZCL_ZDEMO_PO_DPC_EXT 编写代码: 重新执行查看结果 发现lifnr没有取过来debug发现实现类中返回的结果内表不是lifnr,所以更改下abap field name即可(注意重新generate代码会被还原覆盖) 修改后重新编写代码: 三、实现GetEntity方法 查询指定key值的单条记录可以用uri:/sap/opu/odata/sap/ZDEMO_PO_SRV/ZPOHEADERSet('4500000001')来查询,我们发现提示状态501,未实现。要实现单条记录需要实现GetEntity方法。 实现GetEntity方法 重新测试

SAPUI5: get model-data of current select

…衆ロ難τιáo~ 提交于 2019-12-11 12:16:49
问题 I have a detail page (Master/Detail), where I get the key of a model as a parameter: onRoutePatternMatched : function(oEvent) { var key= oEvent.getParameter("arguments").key; var oViewModel = this.getView().getModel("model"); var _sProductPath = "model>/ZSDATLOG_MACHMODELSet('" + key+ "')"; this.getView().setBindingContext(oViewModel); this.getView().bindElement({ path: _sProductPath }); Now I successfully display the detail data in the view. Now I want to read the current row of the model in

How to solve this InvalidCastException while applying ClientCertificate to WCF DataService Client?

一个人想着一个人 提交于 2019-12-11 12:11:12
问题 I have used the examples in this article to add client certificate authentication to my WCF Data Service. I had to change the example slightly because I am using WCF DataService 5.6 in which the SendingRequest event has been deprecated and replaced by SendingRequest2 . Basically this meant changing the following event handler: private void OnSendingRequest_AddCertificate(object sender, SendingRequestEventArgs args) { if (null != ClientCertificate) { ((HttpWebRequest)args.Request)