Questions tagged [odatacontroller]
27 questions
1
vote
1 answer
Entity framework code first custom properties
I use entity framework code first along with OData controllers in spa application, for my composite tables (forexample : Personnel -> PayRolls) i have added two properties in partial class with NotMapped attribute. since i use them later on save…

ali
- 1,023
- 2
- 14
- 38
1
vote
1 answer
OData v4 WebAPI - Get entity from ODataController
In my OdataController I am exposing entity Customer (as an example).
I have a method:
Get()
This works just fine.
To return a single entity I have this method:
GetCustomer(int key)
This also works just fine.
* So here's my Question*
Is GetCustomer…

AlvinfromDiaspar
- 6,611
- 13
- 75
- 140
0
votes
2 answers
C# adding data to a SQL table “Specified cast is not valid.”
C# adding data to a SQL table with ASP.NET throws an error
System.InvalidCastException: "Specified cast is not valid"
This is for a foreign key column with a data type of bigint.
I set my type in C# to be Int64, after int definition threw an error…

Andrew Barker
- 3
- 1
0
votes
1 answer
How to Add authentication for self hosted web API?
I have a self hosted Web API in console project. I need to authroize the
user on role based or domain based.
How can i achieve it.
Sample Code :
-- Here how can i implement the Authentication and authorization --
public class Sample :…

Aravind
- 1,521
- 2
- 12
- 23
0
votes
0 answers
Is there any way to write odata custom filter?
We are facing the problem of odata filter which is related to date and time. Also, we want to filter data with some custom values.
Please let us know if any want to do same
Thank you.

Gawade Pavan
- 73
- 1
- 1
- 6
0
votes
1 answer
Odata controller
I have created a Test OdataController which returns the response in the atom format as given below,I want to use this as Odata Feed in Excel but I get an error as 406 Not Acceptable. What is wrong in the xml? and How to debug in Excel for this Any…
0
votes
0 answers
Get ODataQueryOptions in HTTPPOST method
I am using HTTP POST for getting the data from the ODataController. But I m not able to query my service
[HttpPost]
[EnableQuery]
public IQueryable FetchCCMNewIssueLogViewGridData()
{
var result =…

Ajay Unnikrishnan
- 99
- 2
- 11
0
votes
1 answer
ASP.net client and ODataController issues
I have an ODataController with 2 methods:
[EnableQuery]
public SingleResult- Getitem([FromODataUri] System.Guid key)
{
return SingleResult.Create(db.items.Where(item=> item.guid == key));
}
public async Task
…

MusicMonkey5555
- 55
- 12
0
votes
1 answer
odata query works again ApiController but does not work again ODataController
I try use System.Web.OData.ODataController in WebAPI 2.
WebConfig.cs
ODataModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet("User");
config.MapODataServiceRoute(
routeName:…

the.void
- 13
- 5
0
votes
2 answers
ODataController erroring after return
I have an OData service that is implemented with several MVC controllers using ODataController. I am having an issue with all but one of the controllers, where an Internal 500 error is being returned with nothing of help after my return…

Erik Frantz
- 437
- 4
- 13
0
votes
2 answers
kendo - datasource - parameterMap does not bind parameters
I'm not sure if I'm doing this right, as I'm new to whole these systems, but I want to manage my kendo grid data (pagination, filters, etc).
I'm using this ODataController in ASP.NET Web API 2, driven from version 4 of OData package, which support…

Hassan Faghihi
- 1,888
- 1
- 37
- 55
-1
votes
1 answer
Is it possible to use WebChannelFactory to make requests to WebAPI/OdataController functions/actions?
I have implemented OdataController(s) for my Web-API.
Is it possible to use a ChannelFactory (or WebChannelFactory) to communicate with the Web-API, specifically i would like to call custom Functions and/or Actions.
Of course, the OdataController i…

AlvinfromDiaspar
- 6,611
- 13
- 75
- 140