XeroAPI.Net
XeroAPI.Net copied to clipboard
Enumerations for options that are Strings
Instead of declaring string properties that are string constants like this:
var invoice = new Invoice
{
Type = "ACCREC",
Status = "DRAFT",
Contact = contact
...
}
Why not something like this:
var invoice = new Invoice
{
Type = InvoiceType.AccountsReceivable,
Status = InvoiceStatus.Draft,
Contact = contact
...
}
Implementation could be something like this:
namespace XeroApi.Model.Constants
{
public class InvoiceType
{
public static string AccountsReceivable {
get {return "ACCREC"};
}
public static string AccountsPayable {
get {return "ACCPAY"};
}
}
}
Let me know if you guys think its a good idea and I'll submit a pull request :)