je5real / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

DataTableSerializer - Boolean TypeCode is not covered in ProtoWrite and ProtoRead methods #394

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Please include an e-mail address if this might need a dialogue!
==============

email: slguttikonda@gmail.com

I am using DataTableSerializer code and it is working fine for listed TypeCodes

enum MappedType
        {
            Int16, Int32, String, Decimal, Guid, DateTime
        } 

but, when I used it for Boolean TypeCode it is failing...
added these lines of code to ProtoWrite.

1. Updated MappedType Enum --  added Boolean,Byte

enum MappedType
        {
            Int16, Int32, String, Decimal, Guid, DateTime,Boolean,Byte
        } 

2.  Added below code to ProtoWrite
     case MappedType.Boolean:
         colWriter = value =>
          {
             ProtoWriter.WriteFieldHeader(field, WireType.StartGroup,   
             writer);
             ProtoWriter.WriteBoolean((bool)value, writer);
          };
          break; 

3. Throwing error at ProtoWriter.WriteBoolean((bool)value, writer);

Please provide solution to accept Boolean and Byte TypeCodes.
Thanks,
Lakshmi

Original issue reported on code.google.com by slguttik...@gmail.com on 28 Jun 2013 at 2:57