Skip to main content

All 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 ...
Paul's user avatar
  • 1,274
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 ...
Computer's user avatar
  • 2,227
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 ...
Shubhit304's user avatar
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(...
Grace's user avatar
  • 898
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 ...
Jeremy Bond's user avatar
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 ...
Brody's user avatar
  • 35
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 ...
shantanu kumar's user avatar
-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....
chyplos's user avatar
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; } ...
טל סעדי's user avatar
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 ...
blomster's user avatar
  • 806
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 ...
echrom's user avatar
  • 111
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 ...
doppa harish's user avatar
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 : ...
Nane's user avatar
  • 337
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", "...
Ram's user avatar
  • 1
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 ...
lokusking's user avatar
  • 7,456

15 30 50 per page
1
2 3 4 5
22