Can we you the attached properties in C# class library?
Posted
by Manas Agarwal
on Stack Overflow
See other posts from Stack Overflow
or by Manas Agarwal
Published on 2010-06-07T08:59:22Z
Indexed on
2010/06/07
9:02 UTC
Read the original article
Hit count: 263
c#
Hi
I have implemented the Observer Pattern with lazy load. The class that requests the data from the database is a singleton class. Now I am able to load the data from one database (located in one datacenter) very easily. But I need to get the data from other data centers too and display on the same UI.
I can somehow pass the address of second data center and fetch the data from there also. But once I will get the data from second data center, it will be added to earlier list only. So later it will be thought for me to distinguish between the data. So I thought of attaching a property with the result set, so that while displaying the output I can show the data for both the data centers separately but on the same UI. I thought of attached property as an option where I can attach the data center name with the list of the data obtained.
How is it possible to do in C#?
Thanks
Manas
© Stack Overflow or respective owner