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

EF 6.1 select scalar function result

How to select database scalar function result as column using Entity Framework 6.1 Code First? This is pure SQL query:...SELECT Id AS Id , Name AS Name , dbo.GetAdditionalInfo(Id) AS AdditionalInfo FROM Users WHERE Status = 1 ...Database function ...dbo.G...
c# entity-framework entity-framework-6 sql-server
asked by Spark13

Error while executing db.Database.Migrate(): Incorrect syntax near the keyword 'NOT'

Here's my Dataseeder class:...using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Stac...
asp.net-core asp.net-core-mvc c# entity-framework-core
asked by Nicholas

Use EF6 with ASP.NET Core

I am working a new project - and I want to do it using the latest .NET Core....Reading through the documentation, I came across the comparison between Entity Framework Core and Entity Framework 6.x Comparison. ...Here...Some of the features that I require...
asp.net-core asp.net-core-1.0 entity-framework entity-framework-6 entity-framework-core
asked by Dawood Awan

Can't get stored procedure results with Entity Framework 6

I have a stored procedure which returns a ...0... or a ...1... depending on whether or not a specified email address exists in my database:...CREATE PROCEDURE [DatabaseSchema].[EmailAddressIsDuplicate] (@emailAddress nvarchar(255)) AS BEGIN SET NOCOUN...
c# entity-framework entity-framework-6 sql-server stored-procedures
asked by alex

Linq query using ID returns result to slow (EF Core)

I have the following linq query...internal List<ZipCodeInfo> GetInfoFromZipCode(string zipCode) { using (DbContext context = new DbContext()) { IQueryable<ZipCodeInfo> results; results = (from a in context.Address ...
asp.net-core asp.net-mvc entity-framework entity-framework-core linq
asked by user3587624

Using Include in Entity Framework Core

Question...: How and where the extension method "...Include...", used in the ...Index()... action method, in the following ...PostController... used in the ...Inxex.cshtml view... shown below? As I understand ..._context.Posts.Include(p => p.Blog)... mean...
asp.net-mvc entity-framework-core linq-to-entities
asked by nam

Error when using "Include" method on a LINQ Query

In my following LINQ Query in an ASP.NET MVC Core project, I'm getting the following error ...Unable to cast object of type 'System.Linq.Expressions.NewExpression' to type 'System.Linq.Expressions.MemberExpression'.... The error occurs on the last line of...
asp.net-core c# entity-framework entity-framework-core linq
asked by nam

How to include related tables in DbSet.Find()?

If I want to include related objects in an EF7 query, it's nice and easy:...var myThing = db.MyThings .Include(t => t.RelatedThing) .Where(t => t.SomeCondition == true) .ToList(); ...Also, there's a nice met...
c# entity-framework-core
asked by Shaul Behr

issue with my dbcontext in asp.core. Dont know how to use DbContextOptions object

This is my dbcontext:...public class ShoppingDbContext : IdentityDbContext<User> { public ShoppingDbContext(DbContextOptions options) : base(options) { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {...
asp.net-core-1.0 c# entity-framework entity-framework-core
asked by Robel Haile

Understanding versions of .NET Core and Entity Framework

I can't understand difference between lot of ...ASP.NET Core... framework names: - dnxcore50 - dotnet5.4 - netcoreapp...dotnet5.4... is a new name for ...dnxcore50...? ...I create Class Library project and there is ...dotent5.4... in ...project.json...
asp.net asp.net-core c# entity-framework entity-framework-core
asked by Alexey Markov

ASP.NET Core with EF Core - DTO Collection mapping

I am trying to use (POST/PUT) a DTO object with a collection of child objects from JavaScript to an ASP.NET Core (Web API) with an EF Core context as my data source. ...The main DTO class is something like this (...simplified of course...):...public class...
asp.net-core asp.net-core-webapi automapper entity-framework-core
asked by jmw

Entity Framework Complex Type property as key

Is there a way in Entity Framework to use some complex type as key for an entity and map to existing database?...Let say I have database like this:...create table people ( id int, name nvarchar(128) ) ...and I'd like to map the following C# class structur...
c# entity-framework entity-framework-6
asked by PyroJoke

ASP.NET Core SQL Connection TImeout

I've been working on upgrading an ASP.NET 5 RC1 app to ASP.NET Core 1. I have successfully upgraded it by replacing packages (AspNet to AspNetCore) and changing from EF7 to EF Core (Microsoft.Data.Entity to Microsoft.EntityFrameworkCore)....The issue I'm ...
asp.net-core asp.net-core-1.0 asp.net-core-mvc entity-framework-core
asked by John Oerter

Entity Framework Eager Loading - pass data to ViewModel

In my ASP.NET MVC Core app, from an action method shown below, I'm passing Blogs data and its related data from Posts table to a view as ...return View(await _context.Blogs.Include(p => p.Posts).ToListAsync());... Since I'm passing data from two tables, I...
asp.net-mvc c# entity-framework-core linq-to-entities visual-studio-2015
asked by nam

Unable to edit db entries using EFCore, EntityState.Modified: "Database operation expected to affect 1 row(s) but actually affected 0 row(s)."

I'm using Identity Core 1.0 with ASP.NET MVC Core 1.0 and Entity Framework Core 1.0 to create a simple user registration system with ...this article... as a starting point, and I am trying to add user roles. I can add user roles, but I'm unable to edit th...
asp.net-core asp.net-identity c# entity-framework entity-framework-core
asked by jmk22

System.Data.SqlClient.SqlException: Invalid object name 'dbo.__TransactionHistory'

I get the error ..."System.Data.SqlClient.SqlException: Invalid object name 'dbo.__TransactionHistory'."...when I try creating a ...new dbcontext... using the ...TransactionContext... in EF 6.1.3. It seems like a bug where it's using the transactioncont...
entity-framework entity-framework-6
asked by Hasani Blackwell

Entity Framework Core doesn't work with select(x=>MyClass(x))

the Get(string _date) method below does not work. I get the following exception. I know EFCore is very limited but this exception does not help to see where the problem is exactly at. Can you please explain me what's causing this exception?...An unhandled...
entity-framework-core
asked by Hasan

Microsoft.EntityFrameworkCore.Design' has different version then 'Microsoft.EntityFrameworkCore.Tools'

i have asp dot net core project and i need to make command...$ dotnet ef database update ...But after updating of dotnet this command is causing error like this:......Check that 'Microsoft.EntityFrameworkCore.Design' has been added to "dependencies" in th...
entity-framework-core sqlite
asked by user6200129

How do I create a unique constraint on a field of type string in EF 6?

First, I am new to MVC. ...I have a Project table which has ProjectID, ProjectNumber, and ProjectDescription fields. The ProjectId is an entityKey of type int, the ProjectNumber needs to be a unique constraint. ...How do I do this in entity framework 6.1....
asp.net-mvc c# ef-database-first entity-framework entity-framework-6
asked by user3726459

OUTER JOIN not returning expected results in EF Core

In my ASP.NET MVC Core app the ...POST... action method ...Test... is not returning the expected results. The web app was created using ...this official ASP.NET Core site... and was modified slightly. The real app can be ...downloaded from here... and is ...
c# entity-framework-core linq-to-entities outer-join tsql
asked by nam

Page 78 of 333
  • ««
  • «
  • …
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • …
  • »
  • »»

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!