zzz projects Entity Framework Core EF Core
Home Articles Knowledge Base Online Examples
  • Home
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

6642 results

Caching entity itself in IMemoryCache in ASP.NET Core MVC with Entity Framework

In an ASP.NET Core MVC app I'm using ...IMemoryCache... in ...ConfigureServices()...:...services.AddMemoryCache(); ...In a controller, I originally had this code:...// List<> of POCOs: var myLines = await _context.MyEntity.Where(somecondition).ToListAsync...
asp.net-core-mvc caching entity-framework-core
asked by Feri

Selecting mutiple rows for each distinct value in column EF Core in C#

Language: C#...For simplicitys sake lets say I have a DbSet containing products and the Product class looks like this:...public class Product { public DateTime Time { get; set; } public string Category { get; set; } } ...Time is a record of when t...
c# entity-framework entity-framework-core
asked by Ultimadark

How to convert sql query to entity framework core

I want to convert sql query to entity framework core. SQL query is...select * from Departments where id in(select DepartmentId from SubDepartments where id in(select SubDeptId from Tests where id in(select TestId from PatientTests where PatientId=3)))
entity-framework entity-framework-6 entity-framework-core
asked by SK jha

Need help on table design with Entity Framework Core

I am developing a simple web application where a doctor is adding multiple prescription records for patients and will select multiple drugs while doing prescription. So one patient has multiple prescription and one prescription has multiple selected drugs...
asp.net-core asp.net-mvc c# entity-framework entity-framework-core
asked by newbie_developer

Problem with return type of group join in C#

I have 2 tables (Questions and Answers) each question may have several answers or none. I need return a list of questions with answers of them. I tried to do it but unfortunately the error message below is shown. ...Processing of the LINQ expression 'code...
c# ef-core-3.1 entity-framework-core linq
asked by Amin Kamalinia

Cascade Deletion doesn't seem to work for me in EF Core 3

I have an Entity Framework hybrid project with several related tables. ...I have created the Foreign Keys with Cascades on Delete where appropriate both on the database and in the dbcontext but when I run a delete call to the API the related data gets orp...
c# cascade entity-framework-core foreign-keys
asked by Slagmoth

Entity Framework core: Relation with two not primary keys

I'm working on an old project where I cant make changes to the database, I'm creating a new API using .net core 3. ...I have two tables ...page... and ...Note... that have ...PageId... and ...BookId... in common, so that each Note has one Page with the sa...
.net-core c# entity-framework-core
asked by tamim abweini

EF Core 3 - One-To-Many Relationship is not populating

I've got 2 models - User and Order. A User has many orders and a order has one user....public class User { [Key] public int Id { get; set; } ... public List<Order> Orders { get; set; } = new List<Order>(); } ...public class Order { [...
asp.net-core c# entity-framework-core
asked by Aarivex

Merge properties from mapping table to single class

I have a website that is using EF Core 3.1 to access its data. The primary table it uses is [Story] Each user can store some metadata about each story [StoryUserMapping]. What I would like to do is when I read in a Story object, for EF to automatically ...
c# entity-framework-core entity-framework-core-3.1
asked by Thorny

Case insensitive name of tables and properties in Entity Framework 6

I am in the process of migrating the database from SQL to postgres. The application code is using Entity framework 6. I am facing issues with case sensitivity as postgres stores table, column names in lower case unless using double quotes....The data pres...
entity-framework entity-framework-6 npgsql
asked by user13332671

EF Core include with condition

I'm currently developing something with EF Core and I'm not yet fluent in linq-to-Entity or in linq for that matter....I have two entities that I need to query, one is the customer and the other are the invoices. But I need to retrieve only his/her latest...
c# entity-framework entity-framework-core
asked by gris

How can I process a generic query through ASP.NET Core Web API using Entity Framework?

Ok, I realize this is a loaded question, so bear with me while I break it down....I have a local network with a database, and then I have multiple remote locations with their own databases with similar schemas. The only way to query the databases at the r...
asp.net-core-webapi c# entity-framework-core
asked by eerick

How to get to entities using base DbContext class in EF Core?

My project contains two different databases, which I needed to scaffold at the beginning (database-first approach). I would like to follow the repository pattern, but my repositories need to use different ...DbContext...'s. I wanted to create a ...BaseRep...
.net-core c# entity-framework-core
asked by Bulchsu

Entity Framework Core and Lazy loading problem

I have project in Entity Framework Core 3.1. When I use lazy loading like this:...services.AddDbContext<IQContext>(options => options.UseLazyLoadingProxies().UseSqlServer(...) ...and I call this:... public async Task<Guid> UpdateAsync(object entity ...) ...
.net-core asp.net-core c# entity-framework entity-framework-core
asked by Banana Cake

A second operation started on this context before a previous operation completed upgrading EF Core 2 to EF Core 3.1.3

I just tried upgrading from EF Core 2 to EF Core 3. Every call I have is an Async Task<> method, but I'm still getting the A "Second operation started, see ...https://go.microsoft.com/fwlink/?linkid=2097913..." error. I know it says to await every method,...
asp.net-core asp.net-core-3.0 c# entity-framework-core
asked by Godrules500

EF Core using navigation property when querying parent and child separatedly

I'm currently developing something with EF Core and I'm not yet fluent in linq-to-Entity or in linq for that matter....I have two entities that I need to query, one is the customer and the other are the invoices. But I need to retrieve only his/her latest...
c# entity-framework-core
asked by gris

Cannot implicitly convert type 'System.Collections.Generic.List<<anonymous type: string Access>>' to 'System.Collections.Generic.IEnumerable<string>'

I want to return list of string in function :...private async Task<IEnumerable<string>> GetAccessLevels(Guid roleId) { return await AccessLevels.Where(x => x.RoleId == roleId).Select(x=>new {x.Access }).ToListAsync(); } ...But it show me this error :....
asp.net-mvc c# entity-framework entity-framework-core
asked by mr coder

find not exist item in to list A and aexist in list B in ef core

i have to list and in to list i have list of string :... public async Task<OperationResult<string>> SetAccess(AccessLevelDto accessLevels) { var access = await GetAccessLevels(accessLevels.RoleId); } private async Task<IEnumerable<s...
asp.net c# entity-framework entity-framework-core
asked by mr coder

Entityframework - Include nested children from parent

I'm trying to load two children from a nested parent....dbContext. .Where(f => f.Id == Tenant.Id) .Include(f => f.Users .Select(x=>x.Nicknames) .Select(x => x.FavoriteMovies)) .SingleOrDefault(); ...So above I have a Tenant which has many users. Each user...
entity-framework entity-framework-6 linq-to-entities
asked by MindGame

DbContext.EnsureCreated() : ArgumentNullException only on RELEASE build

I am using microsoft ...ef-core... and ...Sqlite... database in my ...xamarin-forms... app. My model is quite big, so I guess it's not a good idea to drop it here. I was working on the app for couple weeks and tested on my phone in ...Debug... mode - eve...
entity-framework-core sqlite xamarin.forms
asked by neuromouse

Page 332 of 333
  • ««
  • «
  • …
  • 324
  • 325
  • 326
  • 327
  • 328
  • 329
  • 330
  • 331
  • 332
  • 333
  • »

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!