473,320 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

User defined Serialization for LINQ to SQL generated classes

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
Nov 11 '07 #1
0 2647

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike Frayn | last post by:
Hello again, Okay, I was reading the following tutorial on serialization of user-defined classes, and it seems pretty straightforward: http://www.sys-con.com/story/?storyid=44199 That...
1
by: andrewcw | last post by:
There is an error in XML document (1, 2). I used XML spy to create the XML and XSD. When I asked to have the XML validated it said it was OK. I used the .net SDK to generate the class. I have...
0
by: Benjamin Kalytta | last post by:
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...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.