Hello there,
is there a way to override predefined Serializer for LINQ to SQL class objects?
MSLinqToSQLGenerator generates classes for accessing Database.
I want to create a Webservice which should be able to do certain Operation on
Database and should serialize certain objects. Serializer will try to serialize
all object Properties/fields. I need to prevent certain fields to be included in
serialization because of exceptions caused by cyclic depencies within.
Example:
There is a Table "Customers" in Database. LINQ To SQL Generator will generate
class "Customer" like
[Table(Name="dbo.Customers")]
public partial class Customer :
INotifyPropertyChanging,
INotifyPropertyChanged {
....
public int SomeFieldToExclude;
....
Say there is a field "SomeFieldToExclude" that should not be included in any
Serialization (especially for SOAP Webservices). How can I prevent Serialization
of this Field?
Also note, since this class is automatically generated you can (should) not
modify anything in this file however you can create a new file and extend the
same class since it is a partial class.
Is there any way?
Benjamin Kalytta