odata

How to get AngularJS and KendoUI working in harmony?

孤者浪人 提交于 2019-12-22 01:17:36
问题 In stages, I setup my .Net MVC solution and ensured both Angular JS and KendoUI are working independently. app.js: var app = angular.module("app", ['kendo.directives']); and in my controller, I have the following defined: app.controller('contentTypesController', ['$scope', '$log', 'contentTypesRepository', function ($scope, $log, contentTypesRepository) { var a = {}; $scope.status; $scope.contentTypes; $scope.contentTypeOptions; // for testing purposes, but not used - used for navigation

How to access a child object using OData, WebAPI and a DTO?

浪尽此生 提交于 2019-12-22 00:28:44
问题 From a WebAPI controller, I am returning a list of ProjectEditorDTO objects from an OData request /odata/ProjectEditor?$format=json&$inlinecount=allpages&$top=10 : [Queryable] public virtual IHttpActionResult Get(ODataQueryOptions<Website> odataQueryOptions) { var userId = UserContext.Identity.UserId; try { var results = odataQueryOptions.ApplyTo(_uow.Repository<Website>() .Query() .Get() .Where(u => u.UserId == userId) .OrderBy(o => o.WebsiteName)).Cast<Website>() .Select(s => new

implementing oData inlinecount using asp.net webapi [duplicate]

試著忘記壹切 提交于 2019-12-21 23:35:25
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: OData pagination with WebApi ( $inlinecount ) Since Asp.net WebAPi almost supports odata, its very enticing for me to get $inlinecount to work so that it plays nicely with kendo ui ( or any other). So that it returns value in jsonp format, i implemented a new MediaFormatter ( from Stackoverflow). Trouble is that it needs the results to have count element in them in order to get server side paging to work, so for

kendo Grid DataSource with OData format = json

喜夏-厌秋 提交于 2019-12-21 21:38:44
问题 We've asp.net web api odata enabled service which supports variety of OData formats such as application/json;odata=fullmetadata This services is working great with WCF Data Service Client and JayData But our response seems not to be compatible with our kendo grid dataSource I've investigated the response and here is the difference: The demo of kendoUI site which is working fine has following response: "__count": "91" And the response content type is: text/javascript;charset=utf-8 You can see

authenticating with Excel Power Query against .Net Odata Web Api

◇◆丶佛笑我妖孽 提交于 2019-12-21 20:25:46
问题 I am trying to use Power Query to download an Odata Feed that I created using .net Web Api 2 and the OData v4 nuget package. I'm trying to access an Odata feed that requires authentication. When I edit the authentication type in power query, I'm never seeing the authentication key come through in the request. How do you configure Power Query to use a specific type of authentication? Bonus: I'm using OAuth, so how would I configure power query to send in a header with auth data that includes

Why is my WCF Data Service not able to serve an automatically generated ADO.Net EDM?

五迷三道 提交于 2019-12-21 10:40:42
问题 I'm trying to follow this tutorial: http://msdn.microsoft.com/en-us/data/gg601462.aspx to set up an ODATA service. I created (using the wizard) and ADO.NET Entity Data Model from my SQL Server data source using the wizard. Then I set up a WCF Data Service, and told it to use the entities. Instead of serving the data, it produced an opaque server error, which I was able to make less opaque by adding this above the server class def: [System.ServiceModel.ServiceBehavior

Items count in OData v4 WebAPI response

狂风中的少年 提交于 2019-12-21 10:05:30
问题 How to return number of items in OData v4 HTTP response? I need this number to pagination, so it should be number of items after filtering, but before 'skip' and 'top'. I already tried passing '$inlinecount=allpages' and '$count=true' parameters in query options in url (https://damienbod.wordpress.com/2014/06/13/web-api-and-odata-v4-queries-functions-and-attribute-routing-part-2/ - "Example of $count"), but my responses from WebAPI always have only query results (collection) - whole response

Items count in OData v4 WebAPI response

故事扮演 提交于 2019-12-21 10:04:00
问题 How to return number of items in OData v4 HTTP response? I need this number to pagination, so it should be number of items after filtering, but before 'skip' and 'top'. I already tried passing '$inlinecount=allpages' and '$count=true' parameters in query options in url (https://damienbod.wordpress.com/2014/06/13/web-api-and-odata-v4-queries-functions-and-attribute-routing-part-2/ - "Example of $count"), but my responses from WebAPI always have only query results (collection) - whole response

Expose only a subset of .NET OData APIs for a route (return 404 for excluded APIs)

我的未来我决定 提交于 2019-12-21 09:15:35
问题 Background/Context: We have two routes, with different route prefixes: Route 1 prefix: /api Route 2 prefix: /api/partial Currently, we use the same EdmModel for both route prefixes. (See the first code snippit, named "What we currently do"). What we want: We need to only allow a subset of API functionality for Route 2: /api/partial . We want to return 404 when someone tries to access an API that is not available to the "partial" EdmModel Example: We want to return 404 for /api/parial/products

Is there a general method to check whether a property define supported by a Linq provider, especially OData?

孤街醉人 提交于 2019-12-21 08:05:11
问题 I successfully ran the following statement with the NorthWind.sdf in LinqPad: from s in Shippers select new { s.ShipperID, s.CompanyName, Count=s.ShipViaOrders.Count() } At the same time , I failed to run a similar statement with the Odata Service (http://services.odata.org/northwind/northwind.svc) in LinqPad: from s in Shippers select new { s.ShipperID, s.CompanyName, Count=s.Orders.Count() } The error is "Constructing or initializing instances of the type <>f__AnonymousType0`3[System.Int32