Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Enumerations for options that are Strings #35

Open
amhed opened this issue Jul 18, 2013 · 0 comments
Open

Enumerations for options that are Strings #35

amhed opened this issue Jul 18, 2013 · 0 comments

Comments

@amhed
Copy link

amhed commented Jul 18, 2013

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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant