Any QBFC developers out there? I’m using QBFC to pull multiple different types of objects out of Quickbooks: Customers, Items, Invoices, TaxCodes, etc. The data query code really only varies once you get to the Ret object so I’m trying to build some functions to abstract the process.
A typical repose object looks like
IReponseList
IResponse
RetList
Ret
IResponseList and IResponse are both generic enough to work on all query response types. However, there doesn’t appear to be a generic RetList and Ret Interface that I can use for the abstraction. I only have type-sepecific interfaces like ICustomerRetList, ISalesTaxCodeRetList, etc. I’d like to write the code independent of what TYPE of return list it is….
Is there an interface for RetList or Ret that I just can’t seem to find?
Thanks
The interface
IQBBaseis the closest thing to what you’re looking for. Most everything in QBFC is derived fromIQBase, including all query types and all return types. UsingIQBBasereferences and .NET generics it is possible to create a framework to deal with query results.Update: the iterator example below is now available as part of the Zombie library for QBFC, which you can grab from github.
For example, here’s a generic iterator that takes the RetList type and Ret type as parameters: