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

Entity Framework Core - Knowledge Base (KB)

153 results for: in tag: sql

EntityFramework.Extended Update not working - can't convert DynamicProxy

I am using Entity Framework 6 and tried to use EntityFramework.Extended to do some batch updates:...db.TicketOrderItems .Where(i => !i.IsDeleted && !i.Order.IsCompleted && i.Order.OrderDate < margin) .Update(i => new TicketOrderItem { IsDeleted = true...
c# entity-framework entity-framework-6 entity-framework-extended sql
asked by Christoph Fink

Entering keys manually with Entity Framework

I'm trying to use Entity Framework code first for a simple database project and I run into a problem I simply cannot figure out. ...I noticed EF was setting the ID for my tables automatically increasing by 1 each time, completely ignoring the value I ente...
asp.net c# entity-framework entity-framework-core sql
asked by JCafe

Does System.Data.Sqlite support Entity Framework 6?

I looked around, and it was not clear if you could use it in EF6. I've found a compatible version on a blog (...here...) but I'd rather use the official one if possible. Is it compatible or not? ...Thanks!
c# entity-framework entity-framework-6 sql sqlite
asked by It'sNotALie.

How can I configure Entity Framework to automatically trim values retrieved for specific columns mapped to char(N) fields?

I'm working with a third-party database in which all text values are stored as ...char(n).... Some of these text values are primary keys, whereas others are just normal human-readable text. For the latter, I want retrieved values to be automatically trimm...
.net entity-framework entity-framework-6 sql trim
asked by Sam

Entity Framework 6: Code First Cascade delete

So there are several similar questions on here to this, but I'm still having issues determing what exactly I'm missing in my simplified scenario....Let's say I have the following tables, cleverly named after myself: ...'JohnsParentTable' (Id, Description)...
c# entity-framework entity-framework-6 sql
asked by John

LINQ in Entity Framework 6 with large .Any()

I have a EF6 query that takes a list of ...IDs... and does a query:...public IList<Audit> AuditsByIDs(List<int> ids) { return _db.Audits .Include(p => p.User) .Where(p => ids.Any(i => i == p.Id)).ToList(); } ...It works for a ...small ...
c# entity-framework entity-framework-6 linq sql
asked by Ian Vink

Entity Framework 6 Code First Trigger

I'm using Entity Framework 6 Code First, and would like to create a Trigger....How do I do this?...The reason I need the trigger is because a user may either edit the database directly or through a program I'm writing, and I need to make sure 2 columns in...
c# entity-framework entity-framework-6 sql
asked by Charles W

ExecuteSqlCommand on seed to create trigger with EntityFramework throws SqlException

I'm trying to create a trigger to update a document number using the Seed() method in a ContextInitalizer with Entity Framework 6.0.2 and .Net 4. When I run the SQL separately the trigger is created; during context initialization an SqlException is throw...
c# entity-framework entity-framework-6 sql
asked by James Warne

Entity Framework 6 - Save Changes

I am trying to perform an insert with EF 6....I have verified I have a connection to the database, because I can do a read:...List<Driver> drivers = DataContext.Drivers.ToList(); ...With a sql profiler, I can see this do a select on the database, and it r...
asp.net-mvc entity-framework entity-framework-6 sql
asked by user3563552

Entity Framework -- caching an object in memory across multiple contexts

I am using Entity Framework 6 with a tenant-segregated application. I determine the tenant by looking at the request host name, then use it throughout the application, set it in tenant-owned records, et cetera....Every context gets disposed at the end of...
c# entity-framework entity-framework-6 entity-framework-6.1 sql
asked by Casey

Prevent Entity Framework adding ORDER BY when using Include

We have a query similar to the following:...from x in db.Table.Include(x => x.Parent) .Include(x => x.Parent.Relation) .Include(x => x.Relation) .Include(x => x.Children) where /* some query */ select ...
c# entity-framework entity-framework-6 linq sql
asked by Jamie

Entity Framework 6: Are Navigation Properties Smart?

So, I already know that code like this does everything in memory:...SomeDbObject.SomeNavigationProperty.Where(x => x.IsSomeBool); ...In addition to this (still in memory):...SomeDbObject.SomeNavigationProperty.AsQueryable().Where(x => x.IsSomeBool); ...So...
c# entity-framework entity-framework-6 sql
asked by twitchax

Entity Framework Table Per Class Inheritance

I am trying to implement a history table for an entity in EF6, code first....I figured there would be a way to do this with inheritance. The history table, which is a derived type of the actual table entity, just containing straight copies of all the prop...
c# entity-framework entity-framework-6 inheritance sql
asked by tigerswithguitars

Entity Framework 6: filter a table

I', approaching to EF6. I have understood that, if I want a single record, I can use the ...First()... method (usable also like a "get", I think)....But what if I want a collection of records from my table? I mean, if the result of query can have a cardin...
c# entity-framework entity-framework-6 sql
asked by Piero Alberto

Entity Framework 6: Multicolumn unique index featuring navigation property

How can I set multicolumn index on model like that:...public class Meta { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Key] public Guid Id { get; set; } [Index("MetaPeriodDateUnq", IsUnique = true, Order = 2)] [Required] ...
c# entity-framework entity-framework-6 sql sql-server-2008
asked by Sergey Prytkov

entity framework property can't be set to string, has to be nullable int

The 'EmpGipNumber' property on 'Employee' could not be set to a 'System.String' value. You must set this property to a non-null value of type 'System.Int32'....I'm getting this error, and my Employee Model's EmpGipNumber property is declared like this:...
c# entity-framework entity-framework-6 sql
asked by duxfox--

Entity framework connection with oracle database

I am using Entity framework 6.1 version and oracle 11. I am new to entity framework. Can anyone please suggest what are the prerequisites for connecting with oracle. any changes are required in the web.config. In web.config,default it is connecting with s...
entity-framework entity-framework-6 oracle oracle11g sql
asked by AMDI

Files and File Groups in Entity Framework 6

I am trying to split off a read-only, heavily used auditing table from the rest of the database. Putting it in a filegroup and seperate file seems the best solution....However I cannot figure out how to set this up in entity framework, do I need to manual...
c# entity-framework entity-framework-6 filegroup sql
asked by Tim

Entity framework update one column by increasing the current value by one without select

What I want to achieve is the simple sql query: ...UPDATE TABLE SET COLUMN = COLUMN + 1...Is there a way to make it happen without loading all records (thousands) to memory first and loop through each record to increment the column and then save it back?....
c# entity-framework entity-framework-6 sql
asked by ydou

Using SqlQuery<Dictionary<string, string>> in Entity Framework 6

I'm trying to execute a SQL query in EF 6. The ...select... query returns two string columns, e.g. ...select 'a', 'b'..., and can have any number of rows....I'd like to map the result to a dictionary, but I can't get ride of the following error....Error ...
.net c# dictionary entity-framework sql
asked by Akbari

Page 1 of 8
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • ยป

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