ASP.NET Core 1.1 App demonstrating simple CRUD operations using DocumentDB Emulator.
- GET
api/products
- returns all products - GET
api/products/{productId}
- returns product for a specificproductId
- GET
api/products/{productId}/html
- renders productHtml
for a specificproductId
- POST
api/products
- creates a new product, automatically generates anId
, setsCreated
and validatesHtml
- PUT
api/products/{productId}
- updates an existing product, setsUpdated
, validatesHtml
, assumes that the whole object is being updated and does not allow changing restricted fields (Id
,Created
) - DELETE
api/products/{productId}
- deletes a product
ProductsController
is tested usingMicrosoft.AspNetCore.TestHost
as described hereProductRepository
is tested by creating anxUnit Fixture
DocumentDbFixture which assumes thatDocumentDB Emulator
is installed and running.