Quantcast
Channel: Entity Framework
Viewing all 10318 articles
Browse latest View live

Commented Issue: EDMX (and DBML) design surface hangs on Windows 10 [2861]

0
0
Issue
------

When the edmx model has more than ~100 associations, and click whether left or right click makes visual studio unresponsive for minutes at a time. A diagram with no or few associations is fine.

Workarounds
---------------

**Workaround #1: Install VS2015 Update 3 RC**

The fix for this issue will be included in Visual Studio 2015 Update 3. You can get the release candidate of this update from https://blogs.msdn.microsoft.com/visualstudio/2016/06/07/visual-studio-2015-update-3-rc/.

________________

**Workaround #2: Adjust VS graphics options**

The following is reported to resolve the issue for some (but not all) users:
* Navigate to Tools > Options > General
* Untick "Automatically adjust visual experience based on client performance"
* Untick "Use graphics acceleration if available"

________________

**Workaround #3: Avoid Remote Desktop**

Several users have reported the issue only affects them when using Remote Desktop. You could try logging directly into the machine, or using an alternate remote connection technology.
________________

**Workaround #4: Older Windows Version**

Since this issue only affects Windows 10, you can use a previous version of Windows to edit the model.

Updates
---------



**Update Feb-26-2016**

This looks to be a problem with **Microsoft.VisualStudio.Modeling.Sdk** - it has been handed off to that team and they are investigating the cause. We are leaving this issue open to keep a track of the issue on the EF side since it is affecting a large number of customers.

________________

**Update May-24-2016**

The **Microsoft.VisualStudio.Modeling.Sdk** team has implemented a fix for this issue and it will ship in the next updated to Visual Studio 2015.
________________

**Update June-13-2016**

The fix for this issue is included in Visual Studio 2015 Update 3. The Release Candidate of Update 3 is now available https://blogs.msdn.microsoft.com/visualstudio/2016/06/07/visual-studio-2015-update-3-rc/.

________________

Additional Details
-------------------

More details are on a StackOverflow question: [http://stackoverflow.com/questions/33854875/entity-framework-edmx-click-on-diagram-very-slow/33884465](http://stackoverflow.com/questions/33854875/entity-framework-edmx-click-on-diagram-very-slow/33884465).

__ProcDump__ during the unresponsiveness gives this:

```
[External Code]
[Managed to Native Transition]
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.GraphObject.14.0.dll!<Module>.GeoSCursor.search(GeoSCursor* value)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.GraphObject.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.GraphObject.VGGraph.GetObjectsInRect(LRECT bbox, Microsoft.VisualStudio.Modeling.Diagrams.GraphObject.VGLayoutObjectList items, VSGLayoutObject** ignoreItems, int numberItems, int numbertypes, int* types, bool searchSubGraphs)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.GraphObject.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.GraphObject.VGGraph.GetObjectsInRect(LRECT bbox, Microsoft.VisualStudio.Modeling.Diagrams.GraphObject.VGLayoutObjectList items, VSGLayoutObject** ignoreItems, int numberItems, int numbertypes, int* types, bool searchSubGraphs)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.GraphObject.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.GraphObject.VGGraph.get_ObjectsInRectangle(double x0, double y0, double x1, double y1, bool searchSubGraphs)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.GraphWrapper.HitTest(Microsoft.VisualStudio.Modeling.Diagrams.RectangleD hitArea, bool requireCompleteContainment, bool searchSubGraphs)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.GraphWrapper.SpatialQuery(Microsoft.VisualStudio.Modeling.Diagrams.GraphWrapper.SpatialDirection direction, Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement currentShape, Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement parentShape)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement.FindNextInChildShapes(Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement startFromChildShape, bool focusableRequired)
Microsoft.VisualStudio.Modeling.Sdk.Diagrams.14.0.dll!Microsoft.VisualStudio.Modeling.Diagrams.ShapeAccessibleObject.GetChild(int index)
System.Windows.Forms.dll!System.Windows.Forms.AccessibleObject.GetFocused()
System.Windows.Forms.dll!System.Windows.Forms.AccessibleObject.Accessibility.IAccessible.accFocus.get()
System.Windows.Forms.dll!System.Windows.Forms.InternalAccessibleObject.System.Windows.Forms.UnsafeNativeMethods.IAccessibleInternal.get_accFocus()
```
Comments: Thanks for the update @RoMiller

Created Unassigned: Composite primary keys and stored procedure mapping [2931]

0
0
I would like to know if this scenario is supported.
I have a Header table with a composite key (Id int, DeviceId int)

The DeviceId is an id of a given machine, and the Id is generated like an identity on each machine, so when merging all machines data on a main server we don't get violations.

The problem is when i map Header to CRUD SP's i cannot get the Id column generated.
The SP returns the genetared Id, like:
```
SELECT @ModelId AS 'Id';
```
and the mapping is like:
```
s.Insert(i => i.HasName("dbo.SpInsertHeader").Result<int>(r => r.Id, "Id"));
```

I get this error: A result binding for the property 'Id' was not found on the modification function 'SpInsertHeader'. Ensure that the property is database generated.

If i set [DatabaseGenerated(DatabaseGeneratedOption.Identity)] on the Id property i cannot do replication, because the Id column is never sent to the SP.

Thanks,
Frederico

Reviewed: EF 5.0.0 (六月 22, 2016)

0
0
Rated 4 Stars (out of 5) - 下来看看,哈哈哈哈哈哈

Created Unassigned: Nested Extension IQueryable throws exception [2932]

0
0
I'm attempting to define IQueryable extension methods so that they can be reused, but I'm getting an error when calling these extension methods inside of another query.

Consider the following simple model:
```
public interface IActive
{
bool IsActive { get; set; }
}

public class Customer: IActive
{
public int Name { get; set; }
public bool IsActive { get; set; }

public virtual ICollection<Order> Orders { get; set; }
}

public class Order : IActive
{
public int Id { get; set; }
public string OrderNumber { get ;set; }
public bool IsActive { get; set; }
}

public IQueryable<T> OnlyActive(this IQueryable<T> source) where T : class, IActive
{
return source.Where(w => w.IsActive);
}
```

Using the query will work at the top level, such as:

```
Customers.OnlyActive();
```

Or even using it in a select without the extension method:

```
Customers.Select(o => o.Orders.Where(w => w.IsActive));
```

but throws an error when used as such:

```
Customers.Select(o => o.Orders.OnlyActive());
```
Error message is
LINQ to Entities does not recognize the method 'System.Linq.IQueryable`1[Order] OnlyActive[Order](System.Linq.IQueryable`1[Order])' method, and this method cannot be translated into a store expression.

Edited Unassigned: Nested Extension IQueryable throws exception [2932]

0
0
I'm attempting to define IQueryable extension methods so that they can be reused, but I'm getting an error when calling these extension methods inside of another query.

Consider the following simple model:
```
public interface IActive
{
bool IsActive { get; set; }
}

public class Customer: IActive
{
public int Name { get; set; }
public bool IsActive { get; set; }

public virtual ICollection<Order> Orders { get; set; }
}

public class Order : IActive
{
public int Id { get; set; }
public int CustomerId { get; set; }
public string OrderNumber { get ;set; }
public bool IsActive { get; set; }
}

public IQueryable<T> OnlyActive(this IQueryable<T> source) where T : class, IActive
{
return source.Where(w => w.IsActive);
}
```

Using the query will work at the top level, such as:

```
Customers.OnlyActive();
```

Or even using it in a select without the extension method:

```
Customers.Select(o => o.Orders.Where(w => w.IsActive));
```

but throws an error when used as such:

```
Customers.Select(o => o.Orders.OnlyActive());
```
Error message is
LINQ to Entities does not recognize the method 'System.Linq.IQueryable`1[Order] OnlyActive[Order](System.Linq.IQueryable`1[Order])' method, and this method cannot be translated into a store expression.

Created Unassigned: All paths of ConditionalExpression are evaluated [2933]

0
0
When a ConditionalExpression depends on only client variables, I would expect the entire ConditionalExpression to be evaluated in the Funcletizer process. Instead, only the child expressions are evaluated. This can cause issues with ConditionalExpressions used to check for null.

In this example, if the equipment is null, the conditional should evaluate to false. When executing it, I get an error "Non-static field requires a target."

```
Equipment equipment = null;
Expression<Func<Equipment, bool>> expr = (eq) => Equipments.Any(a => (eq != null ? eq.ObjectID : Guid.Empty) != Guid.Empty);
expr.Compile().Invoke(equipment);
```

Modifying the last line of IsClosureExpression to the following makes the query run properly.

```
return ExpressionType.Conditional == expression.NodeType;
```

Created Unassigned: Error on delete in Many-To-Many relationship [2934]

0
0
Hello

I have a simple Context/DataModel setup with a School, Student and 'Class' class,
all identified by a Guid primary key.

One School can have many Students (one to many).
Many Students can have many Classes (many to many).

I have the following fluent-setup:

// Cascade delete for School
modelBuilder.Entity<School>().HasMany(s => s.Students).WithRequired().WillCascadeOnDelete();

// Create a many-to-many relationship between Student and Classes
modelBuilder.Entity<Student>().HasMany(s => s.Classes).WithMany();

The only class defined in the Context is School.

When I try to delete a Student (for a given School), I get the following exception:

{"An error occurred while saving entities that do not expose foreign key properties for their
relationships. The EntityEntries property will return null because a single entity cannot be
identified as the source of the exception. Handling of exceptions while saving can be made
easier by exposing foreign key properties in your entity types.
See the InnerException for details."}

{"A relationship from the 'School_Students' AssociationSet is in the 'Deleted' state.
Given multiplicity constraints, a corresponding 'School_Students_Target' must also
in the 'Deleted' state."}

Note: If I try to delete a Student manually with SQL in the database, everything works fine.
The student is deleted and also the entries in the link table.

Does anyone know what I need to do here?





Created Unassigned: SqlFunctions.CharIndex Incorrect Parameter Order [2935]

0
0
Seen in Version 6.1.3

The parameters for SqlFunction.CharIndex are documented as:

```
// Summary:
// Returns the starting position of one expression
// found within another expression.
//
// Parameters:
// toSearch:
// The string expression to be searched.
//
// target:
// The string expression to be found.
//
// Returns:
// The starting position of target if it is found in toSearch .
//
public static int? CharIndex(string toSearch, string target);
```
However, given the results below, it appears the parameters need to be swapped around in order to achieve the desired functionality.

```
// Called as documented, string to search "ABCDEFG", string to be found "D"
DbContext.Items.Select(o => SqlFunctions.CharIndex("ABCDEFG", "D"));

//Expected Result: 4
//Actual Result: 0

// Called with parameters swapped
DbContext.Items.Select(o => SqlFunctions.CharIndex("D", "ABCDEFG"));

//Result: 4

```
This is also the case for the other 5 overloaded methods.



Created Unassigned: Add option to pass hints to queries (particularly NOEXPAND) [2936]

0
0
Hello,

In an effort to improve some specific queries on a product I am involved in I had to use views with clustered indexes. This particular solution improved the query speed by about 60%, but only in SQL Enterprise. The reason for this is that the enterprise version, unlike Express and Standard, automatically uses the NOEXPAND hint and takes advantage of the clustered index.

In order to overcome the shortcomings of Express and Standard an option to run a query using NOEXPAND hint would be required for EF queries.

I tried using IDbCommandInterceptor approach and it works, but since this interceptor will be used for all queries that are issued with EF the overall performance of the application dropped buy a considerable amount.
We are using EF code-first approach and so far for client that are using SQL Standard the performance improvement of the view is not possible since there is not possible solution for adding NOEXPAND hint.

Commented Unassigned: Timeout Expired after updating to EF 6.1.2 or 6.1.3 [2711]

0
0
Hi!

Recently updated EF to 6.1.3 a project with EF 6.1.1 that was working fine.
After updating it generates
```
{"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."}
```

The same exceptions where generated when tested with EF 6.1.2.

Please see attached generated SQL queries.

Thank You!
Comments: Any news about this issue? Any workaround?

Reviewed: EF 6.1.3 (Jul 06, 2016)

0
0
Rated 3 Stars (out of 5) - Version history not updated with 6.1.3

Created Unassigned: .NET/EF6 ObjectContext leak using compiled LINQ query that references String.StartsWith() [2937]

0
0
Repro:

class Program
{
static void Main(string[] args)
{
var test = new Test();
test.Run();

GC.WaitForPendingFinalizers();
GC.Collect();

Console.WriteLine("set breakpoint here -> Diagnostic Tools -> Take Snapshot -> View Heap -> context still rooted");
Console.ReadKey();
}
}

public class Test
{
public void Run()
{
using (var context = new Model1Container())
{
var sec1 = new Security { SysRowID = Guid.NewGuid(), Company = "Contoso", SecCode = "Foo" };
var sec2 = new Security { SysRowID = Guid.NewGuid(), Company = "Contoso", SecCode = "Bar" };
var sec3 = new Security { SysRowID = Guid.NewGuid(), Company = "Microsoft", SecCode = "Foo" };

context.AddToSecurities(sec1);
context.AddToSecurities(sec2);
context.AddToSecurities(sec3);

context.SaveChanges();
}

using (var context = new Model1Container())
{
Expression<Func<Model1Container, string, string, IEnumerable<Security>>> expression =
(ctx, company, token) =>
(from row in ctx.Securities
where row.Company == company && row.SecCode.StartsWith(token)
select row);

var query = CompiledQuery.Compile(expression);
var result = query(context, "Contoso", "Foo").ToList();
}
}
}



Model:


public partial class Model1Container : ObjectContext
{
public Model1Container() : base("name=Model1Container", "Model1Container")
{
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}

partial void OnContextCreated();

public ObjectSet<Security> Securities
{
get
{
if ((_Securities == null))
{
_Securities = base.CreateObjectSet<Security>("Securities");
}
return _Securities;
}
}
private ObjectSet<Security> _Securities;

public void AddToSecurities(Security security)
{
base.AddObject("Securities", security);
}
}

[EdmEntityTypeAttribute(NamespaceName="Model1", Name="Security")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class Security : EntityObject
{
public static Security CreateSecurity(global::System.Guid sysRowID, global::System.String company, global::System.String secCode)
{
Security security = new Security();
security.SysRowID = sysRowID;
security.Company = company;
security.SecCode = secCode;
return security;
}

[EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Guid SysRowID
{
get
{
return _SysRowID;
}
set
{
if (_SysRowID != value)
{
OnSysRowIDChanging(value);
ReportPropertyChanging("SysRowID");
_SysRowID = StructuralObject.SetValidValue(value);
ReportPropertyChanged("SysRowID");
OnSysRowIDChanged();
}
}
}
private global::System.Guid _SysRowID;
partial void OnSysRowIDChanging(global::System.Guid value);
partial void OnSysRowIDChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.String Company
{
get
{
return _Company;
}
set
{
OnCompanyChanging(value);
ReportPropertyChanging("Company");
_Company = StructuralObject.SetValidValue(value, false);
ReportPropertyChanged("Company");
OnCompanyChanged();
}
}
private global::System.String _Company;
partial void OnCompanyChanging(global::System.String value);
partial void OnCompanyChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.String SecCode
{
get
{
return _SecCode;
}
set
{
OnSecCodeChanging(value);
ReportPropertyChanging("SecCode");
_SecCode = StructuralObject.SetValidValue(value, false);
ReportPropertyChanged("SecCode");
OnSecCodeChanged();
}
}
private global::System.String _SecCode;
partial void OnSecCodeChanging(global::System.String value);
partial void OnSecCodeChanged();
}





Commented Unassigned: .NET/EF6 ObjectContext leak using compiled LINQ query that references String.StartsWith() [2937]

0
0
Repro:

class Program
{
static void Main(string[] args)
{
var test = new Test();
test.Run();

GC.WaitForPendingFinalizers();
GC.Collect();

Console.WriteLine("set breakpoint here -> Diagnostic Tools -> Take Snapshot -> View Heap -> context still rooted");
Console.ReadKey();
}
}

public class Test
{
public void Run()
{
using (var context = new Model1Container())
{
var sec1 = new Security { SysRowID = Guid.NewGuid(), Company = "Contoso", SecCode = "Foo" };
var sec2 = new Security { SysRowID = Guid.NewGuid(), Company = "Contoso", SecCode = "Bar" };
var sec3 = new Security { SysRowID = Guid.NewGuid(), Company = "Microsoft", SecCode = "Foo" };

context.AddToSecurities(sec1);
context.AddToSecurities(sec2);
context.AddToSecurities(sec3);

context.SaveChanges();
}

using (var context = new Model1Container())
{
Expression<Func<Model1Container, string, string, IEnumerable<Security>>> expression =
(ctx, company, token) =>
(from row in ctx.Securities
where row.Company == company && row.SecCode.StartsWith(token)
select row);

var query = CompiledQuery.Compile(expression);
var result = query(context, "Contoso", "Foo").ToList();
}
}
}



Model:


public partial class Model1Container : ObjectContext
{
public Model1Container() : base("name=Model1Container", "Model1Container")
{
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}

partial void OnContextCreated();

public ObjectSet<Security> Securities
{
get
{
if ((_Securities == null))
{
_Securities = base.CreateObjectSet<Security>("Securities");
}
return _Securities;
}
}
private ObjectSet<Security> _Securities;

public void AddToSecurities(Security security)
{
base.AddObject("Securities", security);
}
}

[EdmEntityTypeAttribute(NamespaceName="Model1", Name="Security")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class Security : EntityObject
{
public static Security CreateSecurity(global::System.Guid sysRowID, global::System.String company, global::System.String secCode)
{
Security security = new Security();
security.SysRowID = sysRowID;
security.Company = company;
security.SecCode = secCode;
return security;
}

[EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Guid SysRowID
{
get
{
return _SysRowID;
}
set
{
if (_SysRowID != value)
{
OnSysRowIDChanging(value);
ReportPropertyChanging("SysRowID");
_SysRowID = StructuralObject.SetValidValue(value);
ReportPropertyChanged("SysRowID");
OnSysRowIDChanged();
}
}
}
private global::System.Guid _SysRowID;
partial void OnSysRowIDChanging(global::System.Guid value);
partial void OnSysRowIDChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.String Company
{
get
{
return _Company;
}
set
{
OnCompanyChanging(value);
ReportPropertyChanging("Company");
_Company = StructuralObject.SetValidValue(value, false);
ReportPropertyChanged("Company");
OnCompanyChanged();
}
}
private global::System.String _Company;
partial void OnCompanyChanging(global::System.String value);
partial void OnCompanyChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.String SecCode
{
get
{
return _SecCode;
}
set
{
OnSecCodeChanging(value);
ReportPropertyChanging("SecCode");
_SecCode = StructuralObject.SetValidValue(value, false);
ReportPropertyChanged("SecCode");
OnSecCodeChanged();
}
}
private global::System.String _SecCode;
partial void OnSecCodeChanging(global::System.String value);
partial void OnSecCodeChanged();
}





Comments: note that this works fine (i.e. no leak) if IndexOf(...) == 0 is used instead

Commented Feature: UpForGrabs: DbContext: Make SqlQuery (etc.) honor [Column] [233]

0
0
When using a class like

public MyClass
{
[Column("my_col")]
public string MyCol {get; set;}
}

and selecting this entity using an sql query like

<dbcontext>.Database.SqlQuery<MyClass>("SELECT * FROM myclasstable");

Then the resulting Sql-Statement is like "SELECT MyCol FROM myclasstable" but the column is named "my_col". Therefore an exception is thrown, because column was not found. (Ok, in MSSQL Server case insensitive is the default, but in PostgreSQL this causes an issue.)

We should also consider taking any mapping done with the Fluent API into account.

Also consider Translate etc. on ObjectContext.

This item was migrated from the DevDiv work item tracking system [ID=401604].
Comments: I have column of type public enum ParameterType:byte { Value =1, Enum =2, Reference =3, } and I'm getting The specified cast from a materialized 'System.Int16' type to the 'SamuelServer.Models.Enums.ParameterType' type is not valid.

Created Unassigned: Running Seed method. System.Reflection.AmbiguousMatchException: Ambiguous match found. [2938]

0
0
When running Update-Database a second time

PM> Update-Database
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
No pending explicit migrations.
Running Seed method.
System.Reflection.AmbiguousMatchException: Ambiguous match found.
at System.Data.Entity.Utilities.TypeExtensions.GetAnyProperty(Type type, String name)
at System.Data.Entity.Migrations.DbSetMigrationsExtensions.<>c__DisplayClass9`1.<GetKeyProperties>b__8(EdmMember km)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Data.Entity.Migrations.DbSetMigrationsExtensions.AddOrUpdate[TEntity](DbSet`1 set, IEnumerable`1 identifyingProperties, InternalSet`1 internalSet, TEntity[] entities)
at System.Data.Entity.Migrations.DbSetMigrationsExtensions.AddOrUpdate[TEntity](IDbSet`1 set, Expression`1 identifierExpression, TEntity[] entities)
at NZPost.Addressing.Domain.Migrations.Configuration.Seed(AddressingContext context) in C:\Personal\Development\Projects\Addressing.Domain\Migrations\Configuration.cs:line 29
at System.Data.Entity.Migrations.DbMigrationsConfiguration`1.OnSeed(DbContext context)
at System.Data.Entity.Migrations.DbMigrator.SeedDatabase()
at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.SeedDatabase()
at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
at System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String targetMigration)
at System.Data.Entity.Migrations.DbMigrator.<>c__DisplayClassc.<Update>b__b()
at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
at System.Data.Entity.Migrations.Infrastructure.MigratorBase.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(String targetMigration)
at System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.Run()
at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
at System.Data.Entity.Migrations.Design.ToolingFacade.Update(String targetMigration, Boolean force)
at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Ambiguous match found.

Reviewed: EF 6.1.3 (七月 13, 2016)

0
0
Rated 4 Stars (out of 5) - nice,I like it!

Reviewed: EF 6.1.3 (七月 13, 2016)

0
0
Rated 4 Stars (out of 5) - nice,I like it!

Created Unassigned: Eager loading silently fails when selecting an anonymous type [2939]

0
0
```c#
var results = dbContext.Entities
.Include(entity => entity.ChildCollection)
.Select(entity => new { Entity = entity, Calculation = Entity.NavProperty.OtherInfo * 2 })
.ToListAsync();
```

You would expect some items in `results` to have `.Entity.ChildCollection` filled, but instead `.Entity.ChildCollection` is empty and no warning is given.


Commented Feature: UpForGrabs: DbContext: Make SqlQuery (etc.) honor [Column] [233]

0
0
When using a class like

public MyClass
{
[Column("my_col")]
public string MyCol {get; set;}
}

and selecting this entity using an sql query like

<dbcontext>.Database.SqlQuery<MyClass>("SELECT * FROM myclasstable");

Then the resulting Sql-Statement is like "SELECT MyCol FROM myclasstable" but the column is named "my_col". Therefore an exception is thrown, because column was not found. (Ok, in MSSQL Server case insensitive is the default, but in PostgreSQL this causes an issue.)

We should also consider taking any mapping done with the Fluent API into account.

Also consider Translate etc. on ObjectContext.

This item was migrated from the DevDiv work item tracking system [ID=401604].
Comments: Open since 2012.... I was surprised this wasn't possible. +1 from me....

Created Unassigned: Data Retrieval Behavior Changed After Windows Update: KB3165756 [2940]

0
0
Hello,
I have been using Entity Framework 6.1.3 since its release with no issues, I have been developing an Asp.net MVC application which exclusivly uses Entity Framework 6.1.3 for a little over 19 months now. Wednesday July 13th 2016 I noticed that my laptop rebooted which it does sometimes after I get an update which requires a reboot. That morning I picked up where I left off the night before and ran my last unit test (which passed) the night before but this time it failed because the Navigation property only returned a single row. I thought I must have done something to cause this, after a few hours of searching and testing I found nothing that could cause this so I decided to move on and run the app, once it loaded both my left menu and top menu had 1 menu group, the cause? again the navigation properties only had one returned row. After confirming that this code has not changed in since Feb 2015 I decided to look for another cause. I remembered that my PC was rebooted and found that Windows Update installed 'Update for Microsoft Visual Studio 2015 ( KB3165756)'. If this a known issue? Is there a fix for this? Can I remove this update? This break has crippled my development efforts for two days now. If there is anything I can provide to show this issue I am willing to share it, the source code is on TFS Online. The project is rather large, over 100 database tables most of them are mapped in a single edmx file, I want to mention that I have not had any issues with having a large edmx file other than some slowness when updating the file.

P.S: I tried instaling VS 2015 Enterprise Update 3 hoping it 'might' work this out but there was no change.

Thanks,

Patrick
Viewing all 10318 articles
Browse latest View live




Latest Images