All Questions
Tagged with asp.net-web-api2 entity-framework
323 questions
0
votes
0
answers
39
views
Entity Framework migrations: custom initializer not applying migrations as expected
I'm working on an ASP.NET Web API 2 project, using .NET Framework 4.8 and Entity Framework 6, and I'm facing an issue with custom migrations.
I need to deal with two situations, one where there is a ...
0
votes
0
answers
932
views
Is ASP.NET Core 6 Web API compatible with Entity Framework 6?
I have a class library project which has EF 6 (6.4.4 as listed on the dll) and makes calls to a test database which returns data.
I have a test web project where I can create an ASP.NET Web API 2 ...
0
votes
0
answers
1k
views
Connect Oracle DB with Entity Framework with Code First in VS2022
I need to connect with oracle database using entity framework in my MVC WebAPI project. I am using VS2022 with .Net Framework 4.8. I prefer working with code first approach and need to auto create the ...
0
votes
0
answers
214
views
How to create ASP.NET project from scratch with older version of Entity Framework?
I'm following some online tutorial to create ASP.NET API 2 project, but the tutorial is a bit old (2015), and it used VS2013 + EntityFramework 5.
My version of project VS2013 + .Net 4.5.2 + EF 6.1.1(...
1
vote
2
answers
479
views
System.AccessViolationException WebAPI2 Entity Framework 6
Hoping someone can help me track down a very unrevealing problem. I have a project that uses Web API 2 and Entity Framework 6 on .NET Framework 4.7.2. The project has been working fine for years, we ...
0
votes
2
answers
1k
views
Try to insert image as a binary into the database
When I tried to add the image as binary into my database, using ASP.NET Web API 2 using Entity Framework. I'm getting this error:
The request entity's media type 'multipart/form-data' is not ...
0
votes
1
answer
470
views
Web Api returns same data multiple times
public class VillageDto
{
public int id { get; set; }
public string Name { get; set; }
public string HindiName { get; set; }
public int CentreId { get; set; }
}
public class ...
-2
votes
1
answer
2k
views
If Conditional Statement Checking always check only the first condition in C# ASP.NET [closed]
I've some checking condition with If..Then..Else.. statement but I've something happened that keep confusing me with this problem. My code was :
if ( !context.APIPOS_ExportPos.Any(x => x....
0
votes
0
answers
51
views
ASP.NET Entity Framework load nested related data
I'm trying to load nested related data in ASP.NET Web Api 2 Entity framework.
My code looks like this:
Client.cs:
public class Client
{
[Key]
public int ClientId { get; set; }
...
1
vote
0
answers
377
views
dotnet-aspnet-codegenerator scaffolding controller : Primary key not found
Using netcoreapp3.1 (3.1.6 libraries) in VS Code
I have built a simple web api project, reverse engineered my database (dotnet ef dbcontext scaffold) which contains views that have no keys, which ...
2
votes
3
answers
179
views
linq expression tree many to many IQueryable extension
Im currently working on an asp.net web api 2 application. Please bare in mind my experience is in php,js,css and so on and not c#.
Im hoping someone can help me with my generic IQueryable Extension ...
0
votes
2
answers
301
views
why we use Asp.net WebApi while doing CRUD operations?
we can do CRUD operations using Entity framework but we can also do same CRUD operations using entity framework & Web Api.But why we need to use WEebApi.please give a real time Example..Try to ...
0
votes
0
answers
589
views
Entity Framework scaffolding with multiple fields key in a table
I have a table Users that has IDCompany and IDUserCode as its primary key.
But when I scaffold for New->Controller, it always generates only one field (id) as key:
public class UsersController : ...
0
votes
1
answer
636
views
How to handle POST call with JSON having data with "parent-child" relationship using ASP.NET Web API Entity Framework?
I have a JSON which has a format as given below:
{
"header": {
"source_code": "S12345"
"user_id": "987456"
},
"body":{
"source_code": "S12345",
"wrapper_list": [
{
"item_wrapper_code": "WRAP01",
"...
1
vote
2
answers
834
views
C# OdataV4 Microsoft.OData.Client.DataServiceContext handle Timezone
As stated in the title, i need to know how i can set the timezone to use in an OdataV4 Client.
In our Database we are storing DateTime-Values as GMT+1 since ever.
For quite some time we were using a ...