c# - What kind of setter do I need write for backward compatibility? -


i'm new in oop. please, me. marked property "obsolete", , created 2 collections. kind of setter need write in these(obsolete) properties backward compatibility (i use property in tests , in old version of product)?

[obsolete("this backward compatibility existing database records. use ids instead")] [datamember(name = "id")] public guid id {     { return ids.firstordefault(); } }  [obsolete("this backward compatibility existing database records. use names instead")] [datamember(name = "name")] public string name {     { return names.firstordefault(); } }  datamember(name = "ids")] public guidcollection ids { get; set; }  datamember(name = "names")] public stringcollection names { get; set; } 

how this,

[obsolete("this backward compatibility existing database records. use names instead")] [datamember(name = "name")] public string name {         {         return names.firstordefault();     }     set     {         names = new stringcollection();         names.add(value);     } } 

hope helps...


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -