Example #1
0
        public static Food Deserialize(byte[] buffer)
        {
            var unpack = new BinUnpack(buffer);

            return(new Food
            {
                Id = unpack.ReadGuid(),
                Title = unpack.ReadString(),
                Ingredients = unpack.ReadString()
            });
        }
Example #2
0
        public static User Deserialize(byte[] buffer)
        {
            var unpack = new BinUnpack(buffer);

            return(new User
            {
                Login = unpack.ReadString(),
                Pass = unpack.ReadString(),
                Allergens = unpack.ReadStringArray()
            });
        }