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
Post a Comment