697 questions with Entity Framework Core tags

Sort by: Updated
1 answer

Executing SQL query in Entity Framework Core and returns a list of object

I have the below SQL query. Now I would like to execute this query in Entity Framework Core and get the below list of object. Query: select A.OrganizationId, P.Id as PreferenceId, P.PreferenceTitle, value = CASE …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
asked 2022-08-23T18:32:21.407+00:00
Mohammad Nasir Uddin 41 Reputation points
answered 2022-08-23T20:45:50.833+00:00
Michael Taylor 47,966 Reputation points
0 answers

Converting SQL query having sub query to LInQ

I have the below SQL query. Select a.userid, t.preferenceid, t.preferencetitle, t.isusercontrolled, value = case when( a.value is not null and a.value != t.value ) then a.value else…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
asked 2022-08-23T18:09:28.647+00:00
Mohammad Nasir Uddin 41 Reputation points
commented 2022-08-23T18:52:46.837+00:00
AgaveJoe 26,191 Reputation points
0 answers

Linq dynamically Add Where conditions

Hi, I am getting values from various form inputs and trying to dynamically construct the where clause. I couldn't find a way to, unfortunately. Hope you can help. Here is public async Task<IEnumerable<Order>>…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,234 questions
asked 2022-08-21T16:22:42.18+00:00
Cenk 956 Reputation points
commented 2022-08-23T07:57:09.017+00:00
Jack J Jun 24,286 Reputation points Microsoft Vendor
1 answer

how to write this sql in efcore?

select rank() over(partition by e.Id, e.CreateTime order by e.score desc) id from ScoreInfo how to write it in ef core?

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
asked 2022-08-12T06:27:26.377+00:00
mc 3,641 Reputation points
commented 2022-08-23T06:54:35.587+00:00
Jack J Jun 24,286 Reputation points Microsoft Vendor
1 answer

How to sort a list in ef core? or set a sort value ?

I am creating a table that can easy sort. public MyClassA { public int Id{get;set;} public string Name{get;set;} public int Sort{get;set;} } If I use int Sort to sort the list It will be difficult to add a value between two items; I…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
asked 2022-08-18T09:11:25.487+00:00
mc 3,641 Reputation points
commented 2022-08-20T12:50:49.277+00:00
mc 3,641 Reputation points
2 answers One of the answers was accepted by the question author.

DBContext Inherit from multiple base class

I have just implemented the DuendeIdentity Server and by DBContext looks like this. public class DataContext : ApiAuthorizationDbContext<ApplicationUser> { public DataContext( DbContextOptions options, …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
asked 2022-08-19T16:59:44.02+00:00
Tim Cadieux 21 Reputation points
commented 2022-08-19T19:01:45.883+00:00
Michael Taylor 47,966 Reputation points
3 answers One of the answers was accepted by the question author.

Microsoft.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed during the post-login phase

I am seeing the following exception occur sporadically in my logs: Microsoft.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
Azure SQL Database
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,367 questions
asked 2022-08-10T21:26:31.053+00:00
Mike-E-angelo 466 Reputation points
commented 2022-08-18T10:16:22.743+00:00
Alberto Morillo 32,886 Reputation points MVP
1 answer

How to use efcore get value but may be null?

There is 2 tables: A: public int Id{get;set;} public int CreatorId{get;set;} B: public int Id{get;set;} public string Name{get;set;} I want to get the Name in B according the CreatorId in A but the CreatorId may not in B then I want…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
asked 2022-08-09T05:53:57.443+00:00
mc 3,641 Reputation points
commented 2022-08-18T05:57:23.617+00:00
Jack J Jun 24,286 Reputation points Microsoft Vendor
1 answer

How to get the 2 level data using ef core?

public Class MyCataA { public int Id{get;set} public int TopId{get;set;} } public Class IMGA { public int Id{get;set;} public string ImageUrl{get;set;} public int CateId{get;set;} } I am using…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
asked 2022-08-17T09:56:46.607+00:00
mc 3,641 Reputation points
commented 2022-08-18T01:11:51.84+00:00
mc 3,641 Reputation points
0 answers

Principal.WindowsImpersonationContext on .Net 6 and EF6

Hi, We are currently migrating our projects which are developed on .NET472 to .NET6.0. We had EF6 used for Oracle DB connection and it has been done via Oracle.Manageddataaccess. Now after we changed the underlying projects, we are getting below…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,367 questions
asked 2022-08-12T09:05:34.223+00:00
Sundaram Ramachandran 1 Reputation point
commented 2022-08-17T09:36:38.237+00:00
Jack J Jun 24,286 Reputation points Microsoft Vendor
2 answers One of the answers was accepted by the question author.

Linq Calculate current year and 3 months Cost

Hello, I am trying to get the current year and last 3 months' cost but couldn't figure it out. Can you help me? By the way, I am using EF Core 6. Thanks in advance. using System; using System.Linq; using System.Collections.Generic; …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,234 questions
asked 2022-08-14T12:24:43.83+00:00
Cenk 956 Reputation points
commented 2022-08-17T09:08:22.303+00:00
Cenk 956 Reputation points
2 answers

Azure blob upload - if the pdf file already exists in the blob, then rename pdf file by adding a number at the end?

Hi Expert team, Below is my method and I am able to check if the file already exists in the blob Regarding Azure blob upload - if the file already exists in the blob, then I want to rename pdf file by adding a number at the end.? For…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,157 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,234 questions
asked 2022-08-05T17:59:26.62+00:00
Vamshi 151 Reputation points
commented 2022-08-16T22:37:42.693+00:00
Laxmikant 216 Reputation points
2 answers

DbContext Check all values and compare

Hello, I have orders and order details. I want to check all the order details in order to find out if the status of all the order details is completed. There are a couple of statuses; canceled, completed, continues. How to check the statuses in the…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
asked 2022-08-10T12:29:01.09+00:00
Cenk 956 Reputation points
answered 2022-08-16T12:33:04.307+00:00
Karen Payne MVP 35,036 Reputation points
0 answers

Areas in Class Library

hi folks, I have a Project "MyProject" and another Class Library "AreaProject" project in AreaProject The url /Admin/Product/ takes me to Product Controller ,Index Action but Not able to find View …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,157 questions
asked 2022-08-12T04:58:24.78+00:00
arun maisale 1 Reputation point
commented 2022-08-16T02:24:02.837+00:00
Rena Ni - MSFT 2,061 Reputation points
1 answer

Azure blob container - Improve performance in fetching pdf files from Azure blob container.

Hi Team, Below is my code to fetch the pdf files from Azure blob container. Most of the times the blob container contains up to 5000 pdf files. Issue i am facing: Performance is very slow and taking more time to fetch when there are more than…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,426 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,157 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,234 questions
asked 2022-08-12T17:32:15.503+00:00
Vamshi 151 Reputation points
answered 2022-08-15T18:55:15.58+00:00
SaiKishor-MSFT 17,181 Reputation points
0 answers

How to set field with another one

Hello, I have this OrderDetail class. I want to set the Currency field to ExtendedCurrency. Can I set it in the LINQ query below? Or is it possible to set it in the class? Thank you. public async Task<IEnumerable<Order?>>…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,234 questions
asked 2022-08-12T06:39:43.837+00:00
Cenk 956 Reputation points
commented 2022-08-12T15:47:50.947+00:00
Karen Payne MVP 35,036 Reputation points
1 answer One of the answers was accepted by the question author.

How to get sql from a efcore sentense?

What I want to do is create a conventor from efcore to sql. for example. I have entity:MyStudent DbSet<MyStudent>MyStudents{get;set;}; and there is a textblock. I enter a sentence of efcore. var query=await…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
asked 2022-08-06T08:09:44.893+00:00
mc 3,641 Reputation points
accepted 2022-08-11T02:25:51.127+00:00
mc 3,641 Reputation points
1 answer

How to get hierarchy(children or parent's), using LINQ to EF Core

I have a data structure, such as next class Entity { int Id, int EntityParentId, string Name } And I would like to get all children or parents, could you help me how can I do it with C# LINQ

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,234 questions
asked 2022-08-09T11:35:27.347+00:00
Andrej 221 Reputation points
commented 2022-08-10T13:12:22.9+00:00
Andrej 221 Reputation points
0 answers

EF - checking that an user cannot enter twice the same key - 12 pgms - 8 working well, 4 send an system error msg !!!

Could someone help me? How to catch that kind of exception? I cannot find the InnerException message number as for example with DBupdateException. Thanks in advance for your help. Error msg: System.InvalidOperationException: 'The instance of…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
asked 2022-08-05T17:45:19.4+00:00
Dmtr_Grms 331 Reputation points
commented 2022-08-09T08:08:13.837+00:00
Dmtr_Grms 331 Reputation points
1 answer

No Aceess, CORS Policy

Affecting multiple clients in metro areas ISP comcast, at end users goverment employees and public including colleges and universities. /jobs/48812/field-claim-resololution-specialist-iii,-property/login:1 Mixed Content: The page at…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,157 questions
SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,798 questions
asked 2022-07-04T04:44:53.513+00:00
Nacht 1 Reputation point
answered 2022-08-08T15:31:44.79+00:00
Bruce (SqlWork.com) 55,601 Reputation points