Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

Comparing Object Values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GBR - 01 Mar 2005 13:45 GMT
I have a WebService method that sends to the client an object array received
from the server as a collection. Each element in the object array is a class
entity object. I would like to cache each of these class entities on the
client which is a windows forms. When ready to send back, I would like to
check if any of the class entity field values have changes.

I tried to implement .Equals but does not work. Since the Web Service
stripped the methods. What is the best way I can compare if the class entity
field values have changed?
Dilip Krishnan - 01 Mar 2005 15:05 GMT
Hello GBR,
  Create a helper class that does the comparison. Anything that involves
generated classes will be lost when they are regenerated

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

> I have a WebService method that sends to the client an object array
> received from the server as a collection. Each element in the object
[quoted text clipped - 6 lines]
> stripped the methods. What is the best way I can compare if the class
> entity field values have changed?
GBR - 02 Mar 2005 03:23 GMT
Hi Dilip,

Could you please explain what you mean by Helper Class?

For now, I have implemented an alternate solution. I wanted to write
something generic to compare the object entity values received on the client
through web services. Since none of the object enetity methods cannot be
accesses on the client, I wrote a small function that uses reflection to peep
into the object entity class and compare the values associated with the
object entity fields.

I am not sure if this is a good way of doing it but it works. I pass 2
objects into this new function and it does the rest of the comparison.

Thanks,

> Hello GBR,
>    Create a helper class that does the comparison. Anything that involves
[quoted text clipped - 17 lines]
> > stripped the methods. What is the best way I can compare if the class
> > entity field values have changed?
Dilip Krishnan - 02 Mar 2005 03:36 GMT
Hello GBR,
> I am not sure if this is a good way of doing it but it works. I pass 2
> objects into this new function and it does the rest of the comparison.

Exactly what I meant by a Helper class.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.