public static object Deserializer(System.Type expected, global::Orleans.Serialization.BinaryTokenStreamReader stream) { Example.CreateInventoryItem result = ((Example.CreateInventoryItem)(System.Runtime.Serialization.FormatterServices.GetUninitializedObject(typeof(Example.CreateInventoryItem)))); object objResult = ((object)(result)); object temp1 = ((string)(Orleans.Serialization.SerializationManager.DeserializeInner(typeof(string), stream))); fieldInfo1.SetValue(objResult, temp1); return(objResult); }
public static object DeepCopier(object original) { Example.CreateInventoryItem input = ((Example.CreateInventoryItem)(original)); Example.CreateInventoryItem result = ((Example.CreateInventoryItem)(System.Runtime.Serialization.FormatterServices.GetUninitializedObject(typeof(Example.CreateInventoryItem)))); Orleans.Serialization.SerializationContext.Current.RecordObject(original, result); object objResult = ((object)(result)); object temp1 = input.Name; fieldInfo1.SetValue(objResult, temp1); return(objResult); }
public IEnumerable <Event> Handle(CreateInventoryItem cmd) { if (string.IsNullOrEmpty(cmd.Name)) { throw new ArgumentException("Inventory item name cannot be null or empty"); } if (name != null) { throw new InvalidOperationException( string.Format("Inventory item with id {0} has been already created", Id)); } yield return(new InventoryItemCreated(cmd.Name)); }
public static void Serializer(object untypedInput, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected) { Example.CreateInventoryItem input = ((Example.CreateInventoryItem)(untypedInput)); Orleans.Serialization.SerializationManager.SerializeInner(input.Name, stream, typeof(string)); }