public static IEntity ToEntity(ContractBase contract) { // Do reflection to call the right method here string methodName = string.Format("To{0}", contract.GetType().Name.Replace("Contract", "")); MethodInfo method = typeof(Converter).GetMethod(methodName); return method.Invoke(null, new object[] { contract }) as IEntity; }
public ServerTransaction(object key, TransactionType type, ContractBase contract) : base(key, type) { this.contract = contract; }