Is there a specific reason that the EF requires new data providers and can't make use of ODBC? I figured it had to be some ORM specific problem, but NHibernate works fine via ODBC....I'm using NHibernate and can continue to use Nhibernate, but I worry that I can't assume Nhibernate knowledge for any future programmers here.
I am using the Entity framework to create a new order. The order contains a collection of contacts, a many to many relationship. I want to add a reference to an existing contact on the order on creation of the order. Both Order and Contact a Entity Objects.... Order order = new Order();
//set details on order
Contact contact = new Contact();...
I have a entity called Product,this is a part of it's declration:...[EdmEntityTypeAttribute(NamespaceName="NorthwindModel", Name="Product")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class Product : EntityObject
{
#region Factory Method
/// <summary>
/// Create a new Product object.
/// </summary>
...
I am using Entity Framework in an MVC website...I am trying to get just the number of records using a raw query....I am looking for something along these lines but any will be happy with any solution at all....var sql = SELECT COUNT(*) FROM dbo.Articles WHERE (CategoryID = 3)
var total = _context.Database.SOMETHING(sql)
...I realise that for such ...
I am using Entity Framework 6 and I am using EntityFramework Extended to perform some batch updates and batch deletes. The batch updates and batch deletes work OK however I also need to know the entities that were updated / deleted (i.e. the current and previous values). I thought that using the AuditLogger provided by EntityFramework.Extended wo...
I have code that looks like this:...int retval = databaseContext.Database.ExecuteSqlCommand(command, sqlParameters.ToArray());
...Where databaseContext is of type System.Data.Entity.DbContext...I want to use the return value to know whether or not the stored procedure ran successfuly. Based on ...the documentation...ExecuteSqlCommand... should ret...
I have an application using EF as ORM. The database used to have one schema, dbo and everything was working fine. I recently organized my tables into 4 different schemas. Some tables of one schema have dependencies on tables that reside on a different schema. All seems to be valid on the SQL side....On the app side all db interactions through EF ar...
I have a list of primary key ids for a table whose entities I want to pull into EF memory, modify, and then save....With a single id you would do something like...var entity = dbContext.Entity.Find(id);
entity.SomeColumn = "something";
dbContext.SaveChanges()
...Currently I'm doing something like this to pull all the entities to be modified in on...
Turns out, simply modifying the default T4 template was actually really easy. Inside ...GetTypeName... there is a ...is StructuralType... check which handles all non-primitive types. That pretty well fixed the majority of my issues. Then it was just a matter of ...Ctrl-F... for keywords. My frustration was just getting the best of me when I origina...
I have used Entity Framework to insert data into SQL tables....For larger number of records, instead of ...Add()..., I have used ...AddRange()... and called ...SaveChanges()... later....It's still taking too much time to insert records - are there any solutions to increase the speed? ..._Repository.InsertMultiple(deviceDataList);
await _Repository...