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

convert or cast an EntityCollectionT> from a Listt>

How would you to convert or cast a ...List<T>... to ...EntityCollection<T>...?...Sometimes this occurs when trying to create 'from scratch' a collection of child objects (e.g. from a web form)... Cannot implicitly convert type 'System.Collections.Generic...
c# collections entity-framework
asked by alice7

Without MSDTC, how can I run two Entity Framework Contexts within TransactionScope?

This problem is not readily reproducible in a simple example here but was wondering if anyone has any experience and tips, here is the issue:...using ...Entity Framework...have many points in application where (1) data is written to some ...entity... tabl...
entity-framework msdtc transactions
asked by Edward Tanguay

Exists clause and entity structure

I'm a rookies of EF so, sorry for my perhaps foolish question....I've 2 entities without any relationship (VS does not load the join and I can't manually add it because the primary key of the child uses a derivated key of its parent)....Example...Entity m...
.net entity-framework linq
asked by Enrico

Details about the Entity Framework SaveChanges error

When saving changes with ...SaveChanges... on a data context is there a way to determine which Entity causes an error? For example, sometimes I'll forget to assign a date to a non-nullable date field and get "Invalid Date Range" error, but I get no infor...
c# entity-framework
asked by Marek Karbarz

In an ASP.NET Session object, what is the Entity Framework Object Context?

We have a multi-layered Asp.NET Web Forms application. The data layer has a class called ...DataAccess... which impements ...IDisposable... and has an instance of our Entity Framework Object Context as a private field. The class has a number of public met...
asp.net entity-framework httpcontext objectcontext session
asked by andrej351

Importing an Entity Framework function from code

So I have a stored procedure called Spr_EventLogCreate defined in my database. I have created a function import in my data model called LogEvent with no return type, and I can see this function in the Model Browser tree at...MyModel.edmx > MyModel > Enti...
entity-framework
asked by Mike Chamberlain

Using Unity to create Entity Framework objects for the Unit of Work/Repository pattern

I'm trying to implement the Unit of Work/Repository pattern, as described here: ...http://blogs.msdn.com/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx...This requires each Repository to accept an IUnit...
.net c# entity-framework repository-pattern unit-of-work
asked by TobyEvans

LINQ to Entities apps are being deployed.

I want to use L2E since it's very convenient to my company's apps, I created a demo project, the demo does run on every machine but when I, let's say, press a button that has some code that uses the entity I get this error:...specified store provider cann...
c# entity-framework linq-to-entities mysql winforms
asked by Luiscencio

Update an entity from an ASP.NET MVC page using the post to Edit action

My form includes a subset of Client entity properties and I also include a hidden field that holds an ID of the client. The client entity itself is provided via the GET Edit action....Now I want to do entity update but so far I've only been trying without...
asp.net-mvc entity-framework
asked by mare

Create POCO classes in a distinct project from the Entity Framework model project.

I'm trying to use the Repository Pattern with EF4 using VS2010....To this end I am using POCO code generation by right clicking on the entity model designer and clicking Add code generation item. I then select the POCO template and get my classes....What ...
.net code-generation entity-framework poco repository-pattern
asked by Max

How may an Entity Framework object context be cleaned up?

I am adding several entities to an object context....try { forach (var document in documents) { this.Validate(document); // May throw a ValidationException. this.objectContext.AddToDocuments(document); } this.objectContex...
c# entity-framework
asked by Daniel Brückner

Delete the object and any associated entities.

Does anyone know how to delete an object and all of it's related entities....For example I have tables, Products, Category, ProductCategory and productDetails, the productCategory is joining table of both Product and Category....I have read from ...http:/...
c# c#-4.0 entity-framework linq-to-entities
asked by Waheed

With entity framework, how do you remove an object by id?

It seems to me that I have to retrieve an object before I delete it with entity framework like below...var customer = context.Customers.First(c => c.Id == 1); context.DeleteObject(customer); context.Savechanges(); ...So I need to hit database twice. Is ...
entity entity-framework
asked by Jeff

'The underlying provider failed on Open,' says MSSQL.

I was using an ....mdf... for connecting to a ...database... and ...entityClient.... Now I want to change the connection string so that there will be no ....mdf... file....Is the following ...connectionString... correct?...<connectionStrings> <!--<add ...
c# database-connection entity-framework sql-server
asked by senzacionale

Using Entity Framework and System, there is a problem with cascade delete. Data.SQLite

I have a SQLite DB that is set up so when I delete a Person the delete is cascaded. This works fine when I manually delete a Person (all records that reference the PersonID are deleted). But when I use Entity Framework to delete the Person I get an error:...
.net entity-framework sqlite
asked by jamone

How can I prevent Entity Framework from locking the database?

Possible Duplicate:...Entity Framework with NOLOCK...I'm using EF4 and .Net 4 to load some XML from a file into a database....I have a class the wraps around the ObjectContext and has methods that add the marshalled objects from the XML file to the variou...
entity-framework transactions
asked by James

EntityFramework The argument " is missing from the procedure or function ".

I apologise for asking just a basic question, however I cannot find the cause of this error....I am using Entity Framework to execute a Stored Procedure, and I am passing in four parameters, however the SQL Database seems to reject them. Can anyone point ...
c# entity-framework sql
asked by James

LINQ to Entity using the LIKE SQL operator

I have a LINQ to ENTITY query that pulls from a table, but I need to be able to create a "fuzzy" type search. So I need to add a where clause that searches by lastname IF they add the criteria in the search box (Textbox, CAN be blank --- in which case it...
asp.net-mvc entity-framework linq-to-entities
asked by SlackerCoder

In Entity Framework, how can I remove many rows? (without foreach)

I'm deleting several items from a table using Entity Framework. There isn't a foreign key / parent object so I can't handle this with OnDeleteCascade....Right now I'm doing this:...var widgets = context.Widgets .Where(w => w.WidgetId == widgetId); fo...
entity-framework
asked by Jon Galloway

Entity Framework's "like" queries

How do I get wildcard text searches (like SQL's "like" statement) in ASP.net MVC using the edo entity framework?...I assumed this would work:...var elig = (from e in _documentDataModel.Protocol_Eligibility_View where e.criteria.Contains(query)...
entity-framework wildcard
asked by sslepian

Page 18 of 347
  • ««
  • «
  • …
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • …
  • »
  • »»

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!