Buy Questpond's video subscriptions on
huge discount
.
Online: 11245
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
ASP.NET
>
Loading ...
Why we have to [Serializable] Attribute in the bussiness object class ?
Posted by
Gg
under
ASP.NET
on 7/30/2011 |
Points: 10
| Views : 8140 | Status :
[Member]
| Replies : 1
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
Hi,
Why we have to [Serializable] Attribute in the bussiness object class ?
what will happen If I wont use ?
example:
[Serializable]
public class EqueryRaised
{
#region Private Fields
private string _queryID;
private string _reOpenID;
}
Thanks,
gg.
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
SheoNarayan
on: 7/30/2011
[Administrator]
HonoraryPlatinum
|
Points: 25
0
In order to understand this, first understand what is Serialization, It is a concept of converting an object to a format that can be stored on the disk or can be transferred over network. Deserialization is just opposite means converting the serialized data into the clone of original object. Read more about it at
http://en.wikipedia.org/wiki/Serialization
.
Now why Serializable attribute is needed? The simple answer is that in case you have or will have need to transfer the object from one location to another location (can be machine) via network (eg. you are exposing or consuming wcf or web services). You will have to use this attribute for all your objects that you are planning to consume or send to your consumer so that that class can become serializable and can be transferred via network.
If you will not use this attribute your object will be serialized (as a result you will not be able to expose or consume business objects in any of the services either wcf or web or similar). Read more about serializable attribute at
http://msdn.microsoft.com/en-us/library/system.serializableattribute.aspx
.
Hope this answer your question. Thanks for asking !
Regards,
Sheo Narayan
http://www.dotnetfunda.com
Gg
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
How to get the exact property name while getting error
(0)
PDB file is not showing Line Number in dot net application hosted on server
(0)
Both Strings morethan 5 letters in length end of the words one vowel and one consonent is different
(0)
how to check Any adjacent letters transposed between two strings(ex: JOHN, JHON)
(1)
can't receive data after success login ?
(1)
Implement Multi-Tenant in Azure Logic Apps
(0)
Why ASP.Net Core 7.0 Web API showing as Connection refused?
(0)
Iterating over columns of dataframe and print as rows in Python Django
(0)
More ...