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

Entity Framework 6 - Knowledge Base (KB)

6940 results

Get error when scaffold MS Access database (Could not find installable ISAM)

I am using Entity Framework 6 to manage an MS Access database (mdb file). I am now using this project (bubibubi / EntityFrameworkCore.Jet) But in their example, it uses a * .accdb file while I'm using a * .mdb file. When i execute:...Scaffold-DbContext -C...
db-first entity-framework-6 jet-ef-provider ms-access
asked by Carlos Alberto Armiliato

How to handle duplicate value Exception in Entity Framework?

I have a ...Users... model class which has ...UserID... as primary key. I want to handle the exception if duplicate value for ...UserID... (primary key) is inserted and display a proper message to the user....I tried to handle exception by using ...try {...
c# ef-code-first entity-framework-6
asked by Zahid

how DbContext.AttachRange() works in this scenario

I saw a book with some code like this:...public class Order { public int OrderID { get; set; } public ICollection<CartLine> Lines { get; set; } ... } public class CartLine { public int CartLineID { get; set; } public Product Product { get...
asp.net-core-mvc c# entity-framework-6 entity-framework-core
asked by slowjams

Cast a nullable DateTime in a lambda expression

Using EF6 I want to get all objects of the year 2019 from my database CALENDRIER, but EF6 generates nullables DateTimes "DateTime?" instead of usual DateTimes. Because I want only the year, I could use the Year field from the DateTime to filter my List, b...
asp.net-mvc c# entity-framework-6
asked by M. Ozn

How to avoid connections against empty/null database by Entity Framework

We use entity framework to read from an existing database. This is a simplified version of our code....using (my context context = new mycontext()) { if(context.Database.Connection.State == System.Data.ConnectionState.Closed) { _logger.Inf...
.net c# entity-framework entity-framework-6 sql-server
asked by Vicent Galiana

Entity Framework 6.2 copy many to many from one DbContext to another DbContext

When working with a network database such as MySQL, the DbContext should be short lived, but according to ...https://www.entityframeworktutorial.net/EntityFramework4.3/persistence-in-entity-framework.aspx... the DbContext can be long lived when working wi...
c# entity-framework entity-framework-6 many-to-many sqlite
asked by Jinjinov

How can data be streamed from a LINQ to Entities query?

I'm wondering how one would go about streaming data from SQL server using EF6....Assume having these classes...PersonRepository...EFPerson (EF model)...DomainPerson (Domain model)...PersonUsingClass...Assume that PersonUsingClass depends on getting a bunc...
c# entity-framework-6
asked by Treeline

EF6 How do I retain a custom sql generator while disabling automatic migrations

We use entity framework 6 in our application, along with a Custom Sql Server Migration Generator that handles some edge cases when generating migrations....We use add-migration to add a new migration to the system, and then when the application is deploye...
c# ef-code-first entity-framework-6
asked by dylanT

The argument 'sql' cannot be null, empty or contain only white space. When first create the database

I'm using ...entity framework... to process the ...sqlite... database. If there's no database and I want to insert one record, it will create the database successfully (I found the database file in disk) but throw the error: ...The argument 'sql' cannot b...
c# entity-framework-6 sqlite
asked by Chen Jason

How to get first day of month/year etc?

I'm using ...Linq.Dynamic... to query a ...SQL Server... database....I have a date field named 'EnteredOn' which I need to convert to first second of that month (or year, minute etc)...I tried basically everything, but everything throws an error...Here ar...
date dynamic-linq entity-framework sql-server
asked by Yisroel M. Olewski

Joining two tables using Include() with conditional filter

I have existing code to update. I want to join another table called ...Table3.... Since the query has an ...include... to ...Table2..., I want to add another ....Include... with a conditional filter and avoid a left join....When I add the ....include... w...
c# entity-framework-6 linq sql
asked by c0micrage

Use a variable to call a method

I'm using Entity framework to manipulate a data base, and I was wondering if I could used a variable to call a method...I tried with this way:...string name = "tableName"; db.[name].AddRange(dates.[name]); ...but it didn't work...I want to call a method o...
asp.net c# entity-framework entity-framework-6
asked by Johnatan De Leon

Using Entity Framework with Multiple Databases and Providers in the Same Project (SQL Server and MySql)

Background:...I have an application (both web forms and console) that easily accesses multiple SQL Server databases using Entity Framework code first with no problems. I can switch back and forth between contexts with no errors. Now I'm trying to add in a...
.net c# entity-framework entity-framework-6 mysql-connector
asked by Mike

Update Navigation Property in Entity Framework

I am a new at depth of the Entity Framework I have just wondered why Entity Framework doesn't save changes especially the navigation property although all other properties are already updated Please I want simple explanation ...This is My Service Class ...
c# entity-framework entity-framework-6 lazy-loading
asked by Peter Tharwat

Is a DbContext per thread in Parallel.ForEach safe?

I am working a contract right now to increase the performance of a back end services for a modern SaaS SPA web app that is using EF 6 as their ORM. The first thing I proposed was to introduce some multi-threading to their back end service which is curren...
c# entity-framework entity-framework-6 multithreading parallel-processing
asked by Casey Chester

Using nullable for Foreign Key in Entity Framawork

I use EF Code First approach in an ASP.NET MVC project and I have PK-FK relations on several entities as shown below: ...public class Staff { public int Id { get; set; } //Foreign key for Project public int ProjectId { get; set; } public...
asp.net-mvc c# entity-framework entity-framework-6 sql-server
asked by hexadecimal

Cascade delete in Entity Framework 6 fails to delete dependents. Any suggestions

I am new to Eternity Framework 6 and I read that by default Cascade Delete is enabled. I currently have the following models...public class Student { public int Id { get; set; } public List<Sport> Sports { get; set; } public string StudentNa...
c# entity-framework entity-framework-6
asked by MistyD

Missing map CreateMap exception for related entity (AutoMapper & code first)

I'm struggling with Automapper conventions. How are you mean't to include the related entities in your dto's from code first? I've gone through many examples from various times in Automappers history but nothing works so far. The one that makes most sense...
automapper c# entity-framework-6
asked by brioni

Call stored procedure from EF asynchronously using C# inside async method

We are moving to Entity Framework, however we have a large number of stored procedures. If our Web API uses an async/await pattern all the way to the stored procedure call, how do I handle the call? Can I/should I make it async as well?...I have a db cont...
async-await c# entity-framework-6 stored-procedures
asked by Robin

Entity Framework stored column mapping issue with DTO

I'm retrieving columns from database using a stored procedure and binding values into my DTO class through EF code first approach....I'm facing issue to get the values for ...ReferenceNumber..., ...BookingNumber... properties. I'm getting empty values for...
.net c# entity-framework-6 linq sql-server
asked by user1928165

Page 338 of 347
  • ««
  • «
  • …
  • 333
  • 334
  • 335
  • 336
  • 337
  • 338
  • 339
  • 340
  • 341
  • 342
  • …
  • »
  • »»

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
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!