using System.Collections.Generic;
using System.Globalization;
using System.Runtime.Serialization.Formatters.Binary;
public static void Main()
var result = TradeDateTime(new Transaction { Status = "N", TransRef = "123", TraderAlgoID = "GB123", BuySell = "B", NaturalPersonsIdentifier = "", CounterpartyPassportNumber = "", CounterpartyConcat = "3", TradeType = "OnExch-NoCCP", TradingDateTime = "20210223 10:38:03.658350 +0000", TradingCapacity = "", Quantity = "1000", UnitPrice = "100", PriceNotation = "GBP", VenueTransID = "6767", VenueIdentification = "CostCo" });
Console.WriteLine(result);
private static string TradeDateTime(Transaction item)
var dateTime = DateTimeOffset.ParseExact(item.TradingDateTime, "yyyyMMdd HH:mm:ss.ffffff zzz", CultureInfo.InvariantCulture);
var dateTimeUTC = dateTime.UtcDateTime.ToString("yyyy-MM-ddTHH:mm:ss.ffffffZ");
public const string NumisLEI = "213800P3F4RT97WDSX47";
public string TradeType { get; set; }
public string TransRef { get; set; }
public string TradingDateTime { get; set; }
public string BuySell { get; set; }
public string TradingCapacity { get; set; }
public string InstrumentIdentificationCode { get; set; }
public string TypeOfInstrument { get; set; }
public string UnitPrice { get; set; }
public string PriceNotation { get; set; }
public string Quantity { get; set; }
public string CounterpartyCode { get; set; }
public string VenueIdentification { get; set; }
public string Status { get; set; }
public string CounterPartyCodeType { get; set; }
public string VenueTransID { get; set; }
public string LegalEntityIdentifier { get; set; }
public string IsTAP { get; set; }
public string TraderAlgoID { get; set; }
public string TraderAlgoIDType { get; set; }
public string TraderShortCode { get; set; }
public string WaiverID { get; set; }
public string ExecName { get; set; }
public string InvName { get; set; }
public string NaturalPersonsIdentifier { get; set; }
public string Shortcode { get; set; }
public string DateOfBirth { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string CreatedOn { get; set; }
public string IsManual { get; set; }
public string CreatedBy { get; set; }
public string ManualCreatedOn { get; set; }
public string IsPending { get; set; }
public string IsDeal { get; set; }
public string ShortSellIndicator { get; set; }
public string CounterpartyPassportNumber { get; set; }
public string CounterpartyConcat { get; set; }
public string ReportingDate { get; set; }
public string SITE_EXEC_DECISION_SHORT_CODE { get; set; }
public string ReportingEntity { get; set; }
public string TxnXml { get; set; }
public string ReportingSetId { get; set; }