Tagged Questions
0
votes
0answers
37 views
OData from Web API producing crazy $skip behaviour
I'm pretty new to OData and the Web API, and have run into an odd problem.
I've been trying to use $top and $skip to have a paging table, but whenever I went to the second page (so ...
0
votes
0answers
82 views
How to select a Web API OData Controller scaffold when creating a new controller in VS2012?
This post shows an option creating a controller with the "Web API OData Controller" scaffold right from the Add New/Controller menu option in Visual Studio - IMAGE HERE
I have added the Nuget ...
0
votes
0answers
46 views
The DataServiceCollection to be tracked must contain entity typed elements with at least one key property
I'm having problems loading DataServiceCollection complaining about
System.ArgumentException: The DataServiceCollection to be tracked must contain entity typed elements with at least one key ...
0
votes
1answer
69 views
OData uri for filter collection empty or any eq 4
Using OData, how can I make this filter?
My class
public class Aviso
{
public int Id { get; set; }
public virtual ICollection<User> Destinatarios { get; set; }
public string Url { ...
0
votes
1answer
66 views
Azure - WebAPI + OData - FilterQueryValidator - Role Keeps recycling
I've just deployed WCF web service that includes WebAPI as well. Everything works fine until I add my own Filter Query Validator to my project. Then the role keeps recycling and restarting. It's a ...
0
votes
1answer
200 views
Breeze WebAPI: How to combine QueryResult with ODataQueryOptions to return inlineCount
I tried different ways of loading a list of items using breeze and the API Controller, using filters (partly using a custom object and another part using ODataQueryOptions), but none of them turn out ...
0
votes
2answers
182 views
Post batch request with Breezejs
I've been trying to POST an entity using Breezejs and WebAPI OData Controllers.
Here are the configurations:
config.Routes.MapODataRoute(
routeName: "odata",
routePrefix: "odata",
model: model,
...
0
votes
1answer
157 views
ASP.NET Web Api OData: How to validate Delta<Entity>?
I have a Validation Framework set up to automatically validate parameters of Web Api action methods (including OData action methods). However, this does not work for PATCH requests that store the ...
0
votes
1answer
61 views
rest api that allows update to collection
what would be the best practice for allowing a WebAPI OData based webservice update an entire collection?
For example, we have an admin page that allows users to maintain a list of payment terms. ...
0
votes
1answer
325 views
Implementing $select with WebApi and ODataQueryOptions
I'm trying to implement some OData functionaility with a custom DAL using ODataQueryOptions.
My DAL uses design time generated typed data tables. By intercepting the SelectExpand property of ...
1
vote
2answers
175 views
Breeze working with Web API OData
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 ...
0
votes
2answers
106 views
Setting timeout for WCF Dataservice
I was struggling with some timeouts for an OData service. My first idea was to change the timeout property but I could not find the correct place to do this. Where should be the request timeout set ...
2
votes
1answer
447 views
Web API data paging without using OData syntax
What are the options in a web api to indicate that the returned data is paged and there is further data available.
ASP.Net Web API with OData uses a syntax similar to the following:
{
...
1
vote
1answer
320 views
Web Api Odata action methods using Get verb return 404
I'm trying to expose a document stream as an Action Method on a specific type. It would look something like this:
/odata/MyType(123)/stream <-- this returns a binary stream of data.
When ...
0
votes
1answer
66 views
Query the web Api with OData
I have a web api which has a method to get products. The products belong to a category. Now to get to the problem, when i call the api, it returns a json object of the products but the products dont ...
0
votes
0answers
44 views
Understanding OData and accessing controller actions?
In an MVC application, I could specify a controller and action if I wanted specific data, ie: /Users/GetByGroupID/33 where I would get a list of users in GroupID=33.
Now, I have an MVC application ...
0
votes
1answer
140 views
How to create documention to webAPI Odata
I would like to know if you know how to document WebAPI with OData. That will add
also the Action on each controller.
I looked on Swagger.net but it didn't worked for webAPI odata.
I also did it ...
0
votes
1answer
922 views
OData $select not working on Web API
I'm trying to use OData to return a smaller, paginated result set from my web API. I'm modifying a large, existing API so I would like to be able to do this for only this one controller and method, ...
0
votes
0answers
51 views
Change the name of the field in WebAPI Odata in ODataModelBuilder
I have class with properties and I want to show diffrent property name in the webAPI.
For example DeploymentTypeEnum in my class and in the odata I want to add it with name
DeploymentType.
builder
...
0
votes
1answer
108 views
Patch Entity using lookups
I have the code below:
public class MyPatchController : EntitySetController<Books , int>
{
protected override Books PatchEntity(int key, Delta<Books> patch)
{
var ...
0
votes
0answers
28 views
Odata - Create Derive class from generic class
I have a base class GisLayerExtension.
and a child class GisShapeLayer : GisLayerExtension, IGisShapeLayer where TShape : IMapShape.
How can I create a controller for a Generic class,
Can I use ...
0
votes
0answers
44 views
WebAPI with ODATA - DerivesFrom show only child collection
Does it happened to any one?
The request return like this with only the specific fields.
"odata.type":"GisEntityLayer","odata.id":"http://localhost:53809/odata/GisLayers()","EntityType":"Asset"
},{
...
0
votes
1answer
905 views
.Net WebApi OData Actions that return an Queryable
I want to achieve something close to the RateProduct action described in: http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-actions
In that tutorial it is defined as:
...
0
votes
1answer
58 views
Navigating Odata $metadata to retrieve field names of an entity
I need to dynamically get headers to provide to a Kendo Grid that consumes odata.
0
votes
1answer
351 views
SQL with MVC 4 WebAPI
I've found enough MVC 4 API samples that use a hard-coded array as the data source, but am having trouble finding a simple example with and SQL query.
I have this model:
public class Person
{
...
1
vote
1answer
139 views
create ODataModelBuilder in web.api that has HasNavigationPropertyLink for FK int
I have to class for example:
I want to create NavigationPropertyLink between Class B to class A when AId is a FK.
I succeed to do it for collections but failed to do it for int. I want the ability to ...
1
vote
1answer
698 views
OData with webapi - navigation property
i am writing OData service which is built on WebApi asp.net, i am building my own EDM
ODataModelBuilder builder = new ODataModelBuilder();
builder.Namespace = "Models";
...
1
vote
2answers
685 views
Implementing OData with WebApi and Mapped Models
I am trying to implement OData in WebApi. I am using the repository pattern and EF5 (in the backend) which is still consistent with all the examples I have found. Here is where thing go wonky. I am ...
1
vote
0answers
220 views
How call WebAPi in phonegap?
I am calling Web API by using Datajs and it is working in each browser but when i am calling this by Phonegap then i am getting error
Http Request failed.
function DefaultHandler() {
var ...
0
votes
1answer
168 views
Entity version in odata using accept header in web api
I am using Web API to create RESTful services. I decided to using Accept header as a api versioning mechanism by following this implementation.
...
1
vote
1answer
1k views
Why doesn't my oData response have navigation properties
If you look at the following sample oData feed you'll see included navigation properties for 'child' items to tell you which URL to follow:
...
0
votes
1answer
176 views
Patch entity with delta
I have an override that patches an entity.
protected override Books PatchEntity(int key, Delta<Books> patch)
{
var Book = db.books.FirstOrDefault(p => p.ID== key);
if (Book == null)
...
4
votes
1answer
709 views
web api odata: $select not working
Trying to get this to work. The query returns all rows even though I am specifying only one (?$select=title). On the webapiconfig I have:
var queryAttribute = new QueryableAttribute()
{
...
1
vote
1answer
220 views
“Cannot support querying” Controller Error
I was working through the following answer found here: Web API OData Inlinecount not working
Here is my controller, with some dummy data being served.
[Queryable]
public class ValuesController : ...
0
votes
1answer
299 views
OdataModelConventionBuilder does not understand DbContext generated model
I am currently working with WebApi OData on a project and have run into a very frustrating problem. I am using an Entity Framework database-fist model using the EF5 DbContext setup as is the default ...
1
vote
3answers
759 views
Web API, OData, EF5, Union: The 'Distinct' operation cannot be applied to the collection ResultType of the specified argument
I'm working on a Web API prototype using the OData Nuget package.
I'm having some issues getting a LINQ to EF query to work.
Here are my data model. It has been highly simplified.
I'm trying to get ...
1
vote
1answer
273 views
WebAPI and OData - returning Queryable with preconditions
I have a simple GET method, which returns IQueryable, and has some preconditions on query:
[Queryable(HandleNullPropagation = HandleNullPropagationOption.False)]
public IQueryable<Message> ...
0
votes
1answer
184 views
Is it possible to use oData filtering, sorting, paging in regular WCF serivce?
I need to create a web service which supports filtering. sorting and paging. I had a look at WCF oData service. It has all these features and requires minimum setup. However, I don't think you can ...
0
votes
1answer
935 views
OData with WCF Data Services / Entity Framework
Apologies in advance, this is a long question.
(TL;DR : Does anyone have any advice on using the EF with dynamic fields exposed using WCF Data Services/OData)
I am having some conceptual problems ...
1
vote
1answer
901 views
How to address entity that uses composite identity key in OData Url?
I have an entity OrderItem that has OrderId and ProductId integer fields and these two fields form the identity key/primary key for this table.
I would like to use OData/Web API to expose such ...