Esempio n. 1
0
        public static object Deserializer(System.Type expected, global::Orleans.Serialization.BinaryTokenStreamReader stream)
        {
            Example.CheckOutInventoryItem result = ((Example.CheckOutInventoryItem)(System.Runtime.Serialization.FormatterServices.GetUninitializedObject(typeof(Example.CheckOutInventoryItem))));
            object objResult = ((object)(result));
            object temp1     = ((int)(Orleans.Serialization.SerializationManager.DeserializeInner(typeof(int), stream)));

            fieldInfo1.SetValue(objResult, temp1);
            return(objResult);
        }
Esempio n. 2
0
        public IEnumerable <Event> Handle(CheckOutInventoryItem cmd)
        {
            CheckIsActive();

            if (cmd.Quantity <= 0)
            {
                throw new InvalidOperationException("can't remove negative qty from inventory");
            }

            yield return(new InventoryItemCheckedOut(cmd.Quantity));
        }
Esempio n. 3
0
        public static object DeepCopier(object original)
        {
            Example.CheckOutInventoryItem input  = ((Example.CheckOutInventoryItem)(original));
            Example.CheckOutInventoryItem result = ((Example.CheckOutInventoryItem)(System.Runtime.Serialization.FormatterServices.GetUninitializedObject(typeof(Example.CheckOutInventoryItem))));
            Orleans.Serialization.SerializationContext.Current.RecordObject(original, result);
            object objResult = ((object)(result));
            object temp1     = input.Quantity;

            fieldInfo1.SetValue(objResult, temp1);
            return(objResult);
        }
Esempio n. 4
0
 public static void Serializer(object untypedInput, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected)
 {
     Example.CheckOutInventoryItem input = ((Example.CheckOutInventoryItem)(untypedInput));
     Orleans.Serialization.SerializationManager.SerializeInner(input.Quantity, stream, typeof(int));
 }