Book Image

ServiceStack 4 Cookbook

Book Image

ServiceStack 4 Cookbook

Overview of this book

Table of Contents (18 chapters)
ServiceStack 4 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Using OrmLite filters to create audit functionality


This recipe will cover the use of OrmLite filters and how they can be used to audit what is being added, updated, and deleted in your database. We will also go over the creation of ResultFilter for OrmLite and how this could be incorporated into your own project. In Chapter 1, Configuration and Routing we wrapped this functionality into a plugin, while focusing on the plugin interface. In this recipe we will have a closer look at OrmLite filters.

Getting ready

In this example, we will use the PlacesToVisit domain to show how OrmLite filters can be used to help with requirements such as auditing or protecting sensitive information coming out of your database. To get started, you'll need a new project created either using a template from the ServiceStackVS extension or by following the section Creating a ServiceStack solution with Visual Studio and NuGet in Appendix A, Getting Started.

How to do it…

  1. If we want our model objects to be auditable...