If you're willing to use WCF (for the webservice and the client) you can decorate your Linq2SQL generated classes with the [DataContract] and [DataMember] attributes.
Check the following links for some guidance:
The LINQ-to-SQL classes can be used with
DataContractSerializer (for WCF) easily enough (you need to enable the serialization property in the designer, though). With this in place, you should be able to share the data assembly with the client. As long as you don't use the data-context, the objects themselves should be well behaved (just disconnected - so no lazy loading).
The trick is that you need to re-use these types (from the existing assembly) in your serialization code. If you are using WCF, you can do this with
svcutil /r, or via the IDE.
That said though; it is often cleaner to maintain separate DTO classes for these scenarios. But I'm guilty of doing it the above way on occasion.
- Transferring LINQ data objects
- c# Linq or code to extract groups from a single list of source data
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- How does linq actually execute the code to retrieve data from the data source?
- LINQ Source Code Available
- Using Linq to group a list of objects that contains primitives data into a new grouped list of objects
- Merge duplicate data without affecting others in LINQ code
- Use a linq query as microsoft local report Data Source (WinForms)
- At what point is a LINQ data source determined?
- creating Linq to sqlite dbml from DbLinq source code
- Pass LINQ Group By Data Into New List Of Objects
- read icollection data using LINQ in C# code
- Linq to sql as object data source - designer problem with partial classes
- Dynamic LINQ with Data Objects
- C# LINQ How to get a data source from a db?
- Using LINQ query result for data source for GridControl c#
- Convert flat db row data to nested typed objects linq
- How to swap the data source associated with a Linq query?
- Changing a LINQ objects data context
- Can I use a LINQ IEnumerable result as the data source for a Gtk.TreeView?
- LINQ entity data model generated code error - The type 'DBContexts.Category' already contains a definition for 'ID'
- Find difference between two Data Objects using LINQ
- how to write LINQ to objects equivalent code for this code
- Linq query to get data from array of objects c#
- ASP.Net LINQ data source error is ListView
- LINQ to SQL - Updating Data Context Objects in Partial Classes
- Linq to Objects - query objects for any non-numeric data
- source code for LINQ 101 samples
- Linq query for updating list of objects with some data from another list of objects
- Linq query null check in data source
- unable to print single record instead of getting multiple records in crystal report and Linq
- LINQ with Multiple GroupJoin
- How can I get "levels" of a self referencing table in LINQ?
- Linq join, group, count where count greater than value
- Get string that matched with Any in LINQ
- Merging 2 Xml files using LINQ
- How could I query average and group by using LINQ in ASP.NET C#
- Error when trying to Find a record in a simple table with Linq to Entities
- How to concat expression in linq query
- Convert Datatable to nested list/object using C#
- Call method x times using linq
- Can I have a where clause that works on a grandchild in a LINQ query?
- || (OR) operator in LINQ translated into AND in SQL script
- LINQ's Query using fetch Dictionary object with Room Information
- How to get arguments from an Expression where TDelegate is a callback
- Sql to Linq like syntax
- Search Keywords using LINQ
- Error getting when trying assign linq data into DTO class
- Lambda left join with rows
- Linq deferred execution