I want to expose most of my business layer methods to a Web API project to allow for broader consumption.
One idea is to have one Web API controller per resource.
This boils down to a simple design principle - separation of concerns (SoC), you should have a think about what functionality from your business layer you want to expose and create controllers based on that.
From your example above, you might create a ProductController
and CustomerController
, which could expose the following endpoints:
GET /api/customer/1234 # gets customer by id
POST /api/customer/create # creates a new customer
GET /api/customer/1234/items # gets all items for a customer
GET /api/product/9876 # gets a product by id
POST /api/product/create # creates a new product
Hope that helps...