C# Serializing a Collection of Objects

后端 未结 3 1497
遇见更好的自我
遇见更好的自我 2021-01-07 01:45

I am working on a ASP.NET application that has a class that inherits a List of a Custom Object.

public class UserRoleList : List {
    publ         


        
3条回答
  •  长情又很酷
    2021-01-07 02:42

    Like so:

    [Serializable]
    public class UserRoleList : List {
        public UserRoleList() { }
    }
    

    (Note the 'Serializble' tag will need to be on all classes that need to be serialised (so the parent as well.

    And then use BinarySerialization to do it.

提交回复
热议问题