score:2
could you possibly attach the child entities before you attach the parent entity? would that prevent the attach issue?
just use reflection to get all of the entityref
objects, and attach the entity
property of each to the appropriate table.
Source: stackoverflow.com
Related Query
- LINQ to SQL and Attaching Child Objects
- Odd behavior in LINQ to SQL with anonymous objects and constant columns
- Differences between LINQ to Objects and LINQ to SQL queries
- SQL subquery result in LINQ and Entity Framework Code First
- select and update based on a child objects property minimum value using Linq
- MongoDb c# Linq query and return a collection's child objects
- Linq to SQL Delete/Add Child objects
- Prevent LINQ to SQL from returning child objects
- Linq to SQL returning t1 objects based on t1 and t2 criterias
- Optimise and speed up very slow Linq / SQL code
- How do you populate a parent child data structure from XML where generic List<> objects are in parent and child structures using one LINQ query?
- Comparing child lists of objects using Linq and C#
- How to write SQL translateable linq code that groups by one property and returns distinct list
- De-serialising nested child objects when parsing JSON with C# and Linq
- LINQ to SQL using GROUP BY and COUNT(DISTINCT)
- How are people unit testing code that uses Linq to SQL
- How do you construct a LINQ to Entities query to load child objects directly, instead of calling a Reference property or Load()
- LINQ to SQL and a running total on ordered results
- Linq to Select Parent Objects Where Child Objects Have a Matching Child Object
- Translate SQL to lambda LINQ with GroupBy and Average
- Using Distinct with LINQ and Objects
- How to Convert Row to Column in Linq and SQL
- Linq To SQL and Having
- LINQ to SQL in and not in
- Linq to SQL using group By, and order by count
- Find child objects in list of parent objects using LINQ
- Selecting all child objects in Linq
- Simple sql to Linq query with group by and aggregate functions
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- Linq "Could not translate expression... into SQL and could not treat it as a local expression."
More Query from same tag
- LINQ Get First Rows from Each Query
- SubSonic IQueryable To String Array
- Convert Join and Group By from SQL to LINQ
- Why doesn't this Linq query bring back distinct (unique) results?
- How to update an object in a c# HashSet?
- Decrease 2 GB memory footprint of regex/linq or solve get distinct group values otherwise
- How to get all cells in a particular column?
- Insert into multiple tables (one to one relationships) with Linq queries and SQLite
- Retrieve Parent / Child Query result SQL Server with c#
- LINQ with Contains return zero rows if i am passing empty string
- insert two object in database with linq
- How to select data in rows using LINQ?
- Linq to Sql query with multiple row subquery
- Anonymous Type Error using Union
- linq previous next item?
- Create an XML from a DataTable
- Use LINQ to get a items in a list
- Concat strings in a projection (Linq)
- Is there any efficient way to optimize following Linq
- Checkbox validation with LINQ
- LINQ version of SQL's LIKE statement
- Convert foreach to linq expression with select
- How to sum up an array/list of own classes with an enumerator?
- Complex sum with Entity Framework
- LINQ Unable to retrieve related data from entity framework
- PLINQ not improving the performance
- Linq Query using Case statement and concatenate special character
- How to search Hierarchical Data with Linq in list
- c# - Using LinQ to look for duplicate items in a list and updating object properties if so
- Aggregate functions with a left outer join in LINQ to Entities