You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Classes like CurrencyObjectType and CurrencyObjectIDType could really benefit from having a common interface designed for things that end in ObjectType and ObjectIDType as they are layed out the same no matter the prefix of the type on them.
This would allow for generic functions to be written so as not to repeat the same basic format of code as much.
For instance:
private static CurrencyObjectType BuildCurrencyReference() {
return new CurrencyObjectType {
ID = new List<CurrencyObjectIDType> {
new CurrencyObjectIDType {
type = "Currency_ID",
TypedValue = "USD"
}
}
};
}
private static Payment_TermsObjectType BuildPaymentTermsReference() {
return new Payment_TermsObjectType {
ID = new List<Payment_TermsObjectIDType> {
new Payment_TermsObjectIDType {
type = "Payment_Terms_ID",
TypedValue = "Immediate"
}
}
};
}
Could then be written as:
CurrencyObjectType currencyUSD = BuildTypeCollection<CurrencyObjectType, CurrencyObjectIDType>("Currency_ID","USD");
private static T BuildTypeCollection<T, TU>(string type, string value) where T : ObjectType where TU : ObjectIDType {
return new T {
ID = new List<TU> {
new TU {
type = type,
TypedValue = value
}
}
}
}
The text was updated successfully, but these errors were encountered:
Classes like
CurrencyObjectType
andCurrencyObjectIDType
could really benefit from having a common interface designed for things that end inObjectType
andObjectIDType
as they are layed out the same no matter the prefix of the type on them.This would allow for generic functions to be written so as not to repeat the same basic format of code as much.
For instance:
Could then be written as:
The text was updated successfully, but these errors were encountered: