odata

OData + EF. Writing geography types

孤人 提交于 2019-12-23 03:35:09
问题 I have an Odata service which exposes an EF6 code first model. Some of these entities include DbGeography fields. I can GET these field, despite the DbGeography fields having quite an ugly serialized format, but I cannot figure out how to POST or PUT an entity to the service. The DbGeography type seems to struggle with deserialization. Can anyone provide an example or link for how to do this? 回答1: I've had this problem too. Its a bug apparently. Either two choices here - drop down to EF5 for

CRM 2011 OData relationship query tutorials

时光总嘲笑我的痴心妄想 提交于 2019-12-23 03:28:12
问题 I am looking for some tutorials regarding oData in CRM 2011. In particular I am looking for detailed, in-depth explanations and examples around how to use OData for querying entity relationships Please do not point me at the CRM 2011 OData query designer. While i agree that the tool is great, it offers no explanations as to why/how it generates queries the way they are. 回答1: I suggest you to first look this video. This links were useful for me: MSDN - OData System Query Options Using the REST

OData expanding null

亡梦爱人 提交于 2019-12-23 03:19:23
问题 When using OData and if one of the properties that are being expanded is null i get this error. Is there anyway to solve this? The output I expect is for the expanded property to be null not throw any exception. <m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <m:code/> <m:message xml:lang="en-US">An error has occurred.</m:message> <m:innererror> <m:message> The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json;

ASP.Net Core + EF + OData V4 Core Beta 2

半城伤御伤魂 提交于 2019-12-23 02:36:41
问题 Have a fairly basic Web API project on ASP.NET Core configured with EF which was working okay with Web API. I was following this article to convert to use Odata and I can't quite get it to work. I have a parent object called customer with 2x child objects: Addresses and Person. I have seeded the database so I can see there is data there, and the Odata endpoint looks good because when you start the project it displays the entities and odata/$metadata displays the EDM structure as expected. The

Get OData option set values and names

烈酒焚心 提交于 2019-12-23 02:34:49
问题 I am using odata api, now I have an attribute on an entity that is an option select like : attribute name is : status values are: 1, 2, 3 names: done, progress, new the thing is when I am using postman to fetch metadata and all I get for the fields 'status' its that its type integer. Question how do I fetchj option names and values from metadata so I get values and names in response ? Currently I get this: <Property Name="status" Type="Edm.Int32"> <Annotation Term="Org.OData.Core.V1

List of Collection Names in oData

ε祈祈猫儿з 提交于 2019-12-23 01:14:09
问题 I am little of confused how to get list of collection names from the following odata service http://services.odata.org/V4/Northwind/Northwind.svc/ I just want to get a list of all of the available collection names in the service And then I'd like to let the user choose which collection to view information for, and subsequently show items in that collection For example, the following line accessing to Customers collection. var customers = client.For("Customers").FindEntriesAsync(); I could

WebAPI OData include related entities without using $expand option

无人久伴 提交于 2019-12-22 18:37:12
问题 Expanding upon this earlier question From the documentation here, it states: "When you query an OData entity or collection, the default response does not include related entities." Is there any way to include related entities without using the $expand option? 回答1: No, there is no way to contain the related entities without using the $expand. But if you only want the related ones, you can use navigation property such as: ~/Categories(1)/Products 来源: https://stackoverflow.com/questions/22081436

How can you expose a multi-layer model that has derived classes and members for OData services?

南笙酒味 提交于 2019-12-22 18:16:55
问题 I'm trying to expose a model to be available for OData services. The approach I'm currently taking is along the lines of: 1) Defining a class in the model to expose IQueryable collections such as: public class MyEntities { public IQueryable<Customer> Customers { get { return DataManager.GetCustomers().AsQueryable<Customer>(); } } public IQueryable<User> Users { get { return DataManager.GetUsers().AsQueryable<User>(); } } } 2) Set up a WCF DataService with the queryable collection class such

Web Api oData v4 $ref 404 or server error

坚强是说给别人听的谎言 提交于 2019-12-22 17:50:07
问题 Problem I am able to successfully GET the related items from either end of this relationship using the following: http://localhost/api/Exercises(1)?$expand=Measurements http://localhost:49540/api/Exercises(1)/Measurements Now I am trying to manage the relationship between them. There are a few examples Ive found out there that Ive tried and none work. Heres one and heres another. Models public class Exercise { public int Id { get; set; } public virtual ICollection<Measurement> Measurements {

How to pass authentication header to OData Service

筅森魡賤 提交于 2019-12-22 11:35:42
问题 I am following authentication method described at http://blogs.msdn.com/b/astoriateam/archive/2010/07/21/odata-and-authentication-part-6-custom-basic-authentication.aspx I am able to consume service using ASP.NET (not a problem at all). Now I would like to create a plain HTML page and access the service using "OData Javascript Library" (datajs). If I disable authentication and request for data, it works fine. I could not find any sample code on how to send authentication header information