c# - Serialize read-only collection without implementing IXmlSerializable -


i have class :

[serializable] public class profile {     [xmlattribute]     private string[] permissions;     public string[] permissions     {         { return permissions; }         set { permissions = value; }     } } 

i want serialize in xml xmlserializer , have compliant fxcop. problem fxcop wants expose read-only collection properties, of course readonlycollection not serializable. not want implement ixmlserializable because it's painful. there other solution ?

options:

  • you use list-of-string rather string-array; doesn't need setter, collection can manipulated directly
  • you accept fxcop going generalisation, , generalisation not appropriate specific context - meaning: ignore fxcop in case

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -