コード例 #1
0
 public byte[] Serialize()
 {
     using (MemoryStream m = new MemoryStream())
     {
         using (BinaryWriter writer = new BinaryWriter(m))
         {
             writer.Write(Id);
             writer.Write(DateOfBirth.ToBinary());
             writer.Write(Gender);
             writer.Write(Ethnicity);
         }
         return(m.ToArray());
     }
 }