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

In Entity Framework 6.1 (not Core), how can I use the IndexAttribute to define a clustered index?

Entity Framework 6.1 (code-first) has added the possibility of adding indexes via the ...IndexAttribute.... The attribute takes a parameter for specifying whether the index should be clustered or non-clustered....At the same time, AFAIK, Entity Framework ...
c# entity-framework entity-framework-6 indexing
asked by Fabian Schmied

Error when running Seed method using code first EF 6

I was trying to run the update-database command to insert some initial data in my database and I got and error. Here is my class:...[Table("NotAllowedDomain")] public class NotAllowedDomain : Entity { [Key] public int DomainId { get; set; } p...
ef-code-first ef-migrations entity-framework entity-framework-6
asked by ddieppa

Entity Framework 6 Adding properties to join tables

This is the scenario: I have a products table and a categories table. The relationship is many-to-many: a category can have 1 or more products....and a product can be in 1 or more categories......The Code-First mapping looks like this.......public class P...
c# e-commerce entity-framework entity-framework-6
asked by rnirnber

EntityFramework : FindBy (column name) select arbitrary column by expression tree

I have a very simple code of what I am trying to achieve here....Basically the idea here would be to be able to do a simple ...FindBy(x => x.<the_column_name>, <the value>);... therefore I wouldn't have to copy-paste the same query by changing only the co...
c# entity-framework entity-framework-6 linq
asked by Erick

Group By Query with Entity Framework

In my application I have ...Movements... associated with a ...category.... I want a list of the most frequent ...category.... ...My objects are: ...Category...: ...catId..., catName ...Movement...: Movid, movDate, movMount, ...catId...I think it would h...
c# entity-framework entity-framework-6 group-by linq
asked by Migue

How can you add a navigation property on a view in EF 6.1 CodeFirst

Let's make a case to explain my problem. ...MyTable1...+id...+myTable2Id...MyTable2...+id...MyView1...+id...+myTable2Id...MyView1 exists in the case, from data from the MyTable1. Now i want to create a Navigation property from my EF6.1 Code first approach...
c# entity-framework entity-framework-6 entity-framework-6.1 navigation-properties
asked by Spons

AddOrUpdate does not modify children

I am using AddOrUpdate in my seed method to keep my permissions up to date, however, in the situation where the below code is updating the existing role (rather than creating it), any new Permissions I created are not being added to the role. What am I do...
.net c# entity-framework entity-framework-6
asked by pquest

Entity Framework 6 GUID as primary key: Cannot insert the value NULL into column 'Id', table 'FileStore'; column does not allow nulls

I have an entity with primary key "Id" which is Guid:...public class FileStore { public Guid Id { get; set; } public string Name { get; set; } public string Path { get; set; } } ...And some configuration:...protected override void OnModelCreat...
c# entity-framework entity-framework-6 sql-server-2008
asked by Algirdas

How to set the isolation level for Entity Framework CodeFirst Migrations

If you run an entity framework migration (either automatic or explicit) against tables published for SQL Server replication you get the following error: ...You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels....
c# ef-migrations entity-framework entity-framework-6 sql-server
asked by Paul-Jan

Comparing byte array in Entity Framework where clause

Is it possible to compare a byte array in the where clause using Entity Framework?...I've got a list of bytes like this:...List<byte[]> VisitorIDList ...I need to pull some data like this:...var VisitorList = context.Visitors .Where(a => VisitorIDLis...
c# entity-framework entity-framework-6
asked by Ricketts

EntityFramework 6.1 cannot connect

I have a class library I have been using for over a year that has recently stopped working after upgrading to EF 6.1....I have tried various methods for passing in the connect string to my Context class constructor but while it seems to correctly pass the...
entity-framework entity-framework-6
asked by CJR

The item with identity 'Id' already exists in the metadata collection. Parameter name: item

All of my entities have a base class:...public class Entity<TKey> : IEntity<TKey> { dynamic IEntity.Id { get { return this.Id; } set { this.Id = value; } } public TKe...
c# entity-framework entity-framework-6
asked by beardeddev

Entity Framework query ToString won't produce SQL query

Through my research I've discovered that, since at least EF 4.1, the .ToString() method on an EF query will return the SQL to be run. Indeed, this very frequently works for me, using Entity Framework 5 and 6....However, occasionally I call this method and...
c# entity-framework entity-framework-5 entity-framework-6
asked by TheRubberDuck

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

Conventions for joins in Entity Framework 6.1.0 Code First

I believe my question is simple (not sure if the answer is as well):...Does anybody know how to force Entity Framework to use "INNER JOIN" as default convention, instead of "LEFT OUTER JOIN"?
entity-framework entity-framework-6
asked by Marco Alves

LINQ and EF6: The context cannot be used while the model is being created

I have an MVC 5 Application with EF6, and I tried my first LINQ query in a SignalR Hub. It runs when I click on a button on a Test view page....But I get an exception at the query:...This query is my first individual code action in the MVC5 template with ...
asp.net-mvc c# entity-framework entity-framework-6 linq
asked by Tornister

EF in WinForms: how to filter data in BindingSource/DGW (.Local.ToBindingList())

I generated an EF model (Database first) and DataSource following this tutorial ...http://msdn.microsoft.com/en-us/data/jj682076.aspx...On my form I created BindingSource (bsUsers) and bound DataGridView to it. ...Here is how I load data on form startup:....
ado.net c# entity-framework entity-framework-6 winforms
asked by Alex P.

After upgrade to EF6 - The property cannot be configured as a navigation property

I have a following class:...[Table("TagSource")] public class TagSource { public TagSource() { this.DataSources = new HashSet<DataSource>(); } [Key] public int TagSourceId { get; set; } ... public bool IsHistorical { g...
asp.net-mvc-5 entity-framework entity-framework-6
asked by christof

Entity Framework - Unable to load the specified metadata resource

I realise that this has been asked a number of times but I just can't seem to get the bottom of my issue. I'm getting the following error stack:...When I reflect out my dll I can see the following...Reading ...http://blogs.teamb.com/craigstuntz/2010/08/13...
c# entity-framework entity-framework-6
asked by Steve Newstead

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

Page 12 of 333
  • ««
  • «
  • …
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • …
  • »
  • »»

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!