score:1
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:
score:2
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.
Source: stackoverflow.com
Related Query
- 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
More Query from same tag
- linq case statement
- Use Linq instead of Icomparable
- Is List.ForEach technically a part of LINQ or not?
- Nested classes query and join
- Entity Framework query student grade for a specific subject
- LINQ generate entity without my consent
- LINQ - type arguments cannot be inferred from the usage in a select
- How to select items containing any word in a string using Entity Framework 6?
- LINQ: How to remove element from IQueryable<T>
- Can I use LINQ GroupBy to do this more cleanly?
- How do I get Linq to return identical repeated rows only once?
- Accessing List<BaseClass> by specifying derived class
- Linq to entities outer join, then an inner join
- Linq where clause with DbFunctions.DiffDays and string comparison not working
- Spatial Join in Entity Framework
- Converting data from one class to another
- Visitor Pattern versus LINQ-style fluent syntax for tree traversal API
- Reflecting on executing assembly
- Indexes for LINQ queries
- In MVC modeling, how do I bind a property to another model?
- How to get the index of element inside nested Lists
- Linq to return all rows with the same (lowest) value
- Grouping in Linq with TimeSpan.Hours
- C# Using block context, within another using block context
- LINQ/Projection - Contains all wildcard for filtering
- Combining Two Arrays & Projecting
- How can I pass an entity property as a parameter of a LINQ Expression?
- LINQ method to find the value for a specific key without looping? (Parsing a json in C#)
- Joined tables in entity framework C# efficient method
- Can I use the "Count" property on a Linq result?