public VnthTransfer DeserializeJson(string json) { var transfer = new VnthTransfer(); //stream to object return transfer; }
public VnthTransfer DeserializeJson(string json) { var transfer = new VnthTransfer(); //stream to object return(transfer); }
public void SerializeJson() { VnthTransfer transfer = new VnthTransfer() { SourceInfo = new VnthAccountInfo(), DestinationInfo = new VnthAccountInfo(), TransferType = TransferType.Outcome, Amount = 12, TitleOfTransfer = "", DateOfTransfer = new DateTime(), DateOfRecord = new DateTime() }; DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(VnthTransfer)); MemoryStream stream = new MemoryStream(); serializer.WriteObject(stream, transfer); }