public T Deserialize <T>(Stream requestStream)
        {
            var type = typeof(T);

            if (type == typeof(SpecialCustomerPoco))
            {
                object poco = new SpecialCustomerPoco(Common.GetString(requestStream));
                return((T)poco);
            }

            throw new InvalidCastException();
        }
        public void Serialize <T>(T response, Stream responseStream)
        {
            string data;
            object obj = response;

            if (response is SpecialCustomerPoco)
            {
                SpecialCustomerPoco poco = (SpecialCustomerPoco)obj;
                data = poco.Data;
            }
            else
            {
                throw new InvalidCastException();
            }

            responseStream.Write(Encoding.ASCII.GetBytes(data), 0, data.Length);
        }
示例#3
0
 public SpecialCustomerPoco NoInterfaceCustomerTypeSerializerMethod(SpecialCustomerPoco input)
 {
     Common.LogCommonData("NoZeroParameterConstructorCustomerTypeSerializerMethod", input.Data);
     return(new SpecialCustomerPoco("(([NoZeroParameterConstructorCustomerTypeSerializerMethod]))"));
 }
示例#4
0
 public SpecialCustomerPoco ExceptionInConstructorCustomerTypeSerializerMethod(SpecialCustomerPoco input)
 {
     Common.LogCommonData("ExceptionInConstructorCustomerTypeSerializerMethod", input.Data);
     return(new SpecialCustomerPoco("(([ExceptionInConstructorCustomerTypeSerializerMethod]))"));
 }
示例#5
0
 public SpecialCustomerPoco CustomSerializerMethod(SpecialCustomerPoco input)
 {
     Common.LogCommonData("CustomSerializerMethod", input.Data);
     return(new SpecialCustomerPoco("(([CustomSerializerMethod]))"));
 }