score:8
Accepted answer
when you update the .dbml file the .designer.cs file is also regenerated but if this file is not accessible a new file is generated and added to the project. since the classes in both files are partial but have the same properties and fields on compile you will get this error.
you can check if you have only one designer generated file for your context. you can do that by right clicking on the name of your class and selecting "go to definition" - it will show all files containing definition of your class.
Source: stackoverflow.com
Related Query
- LINQ entity data model generated code error - The type 'DBContexts.Category' already contains a definition for 'ID'
- How to convert the return type of the model data from Product entity to ProductViewModel objects using LINQ select?
- Unable to cast the type 'System.Int32' to type 'System.Object'. LINQ to Entities only supports casting Entity Data Model primitive types
- linq sql error : the text data type cannot be selected as distinct because it is not comparable
- Unable to project the anonymous type to model type. (The entity or complex type cannot be constructed in a LINQ to Entities query.)
- Entity Framework Code First - The entity or complex type cannot be constructed in a LINQ to Entities query
- The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties
- The LINQ expression node type 'Invoke' is not supported in LINQ to Entities in entity framework
- Linq error generic parameter or the query must use a nullable type
- LINQ to Entities only supports casting Entity Data Model primitive types?
- The specified type member is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported
- The entity or complex type ... cannot be constructed in a LINQ to Entities query
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- LINQ query returns error "The expected type was 'System.Int32' but the actual value was null."
- The entity or complex type cannot be constructed in a LINQ to Entities query
- How does linq actually execute the code to retrieve data from the data source?
- What is the return type for a anonymous linq query select? What is the best way to send this data back?
- PostgreSQL, Linq C# error 'could not determine data type of parameter $1'
- The given value of type String from the data source cannot be converted to type int of the specified target column
- WCF Data Services, DTO, and Entity Framework: The argument to DbIsNullExpression must refer to a primitive, enumeration or reference type
- Expression... LINQ to Entities only supports casting Entity Data Model primitive types”
- What are the major differences between Data Access Application Block, NHibernate, ADO.NET Entity Framework and LINQ to SQL?
- Linq to Sql NotSupportedException "The explicit construction of the entity in a query is invalid" when selecting new Type of other Database Table
- Entity Framework LINQ projection into custom type results in missing data
- Error "The LINQ expression node type 'Invoke' is not supported in LINQ to Entities" in where clause inside the method
- The entity or complex type 'OdeToFood.Models.RestaurantListViewModel' cannot be constructed in a LINQ to Entities query
- How to swap the data source associated with a Linq query?
- code first approach error: the specified type member 'yyyxx' is not supported in linq to entities
- C# - The entity or complex type cannot be constructed in a LINQ to Entities query
- LINQ ERROR : Explicit construction of entity type
More Query from same tag
- how to take desired value from the multiple same elements in the xml by using LInq c#
- Why doesn't deferred execution cache iterative values?
- Initilize var by if - else
- Invalid length for a Base-64 char array in LINQ TO SQL
- Exception when databinding result from contact query in wp8 c#
- Where can I get information on the ! operator used by VB.Net in Linq to DataSet?
- Nested Sorted Group w/ Counts
- Read from CellSet using LINQ
- LINQ Include command mvc3 and webgrid
- Selecting a tree from a csv using LinQ
- Get closest day in future in a LINQ expression
- Linq to get elements in a list (parent) where a condition is satisfied on property of an object in a child list?
- Specified cast is not valid Linq Query
- Linq grouping and seting datatables
- LINQ-to-List and IEnumerable issues
- LINQ GroupBy Select only where key is not null
- How to define default values with Entity Framework C#?
- LINQ, simplifying expression - take while sum of taken does not exceed given value
- Using LINQ to combine the results of 2 queries
- Linq Query with Any() using in memory object and db
- Linq equivalient to JavaScript's join?
- LINQ to Entities only supports casting Entity Data Model primitive types?
- How to get what exist in the first datatable and not exist in the second data table in a third one?
- How do you override lazy loading on a single LINQ query using Fluent NHibernate
- How can I use SelectMany on my IQueryable of classes?
- Performance Comparison of Two Linq Calls
- Converting SQL to LINQ (left join on two fields)
- LINQ to Entities does not recognize the method 'System.Windows.Forms.DataGridViewCell get_Item(Int32)' method
- Linq to Dictionary<string, List<string>> with Null values
- EF deferred execution using SQLquery as input