-
Notifications
You must be signed in to change notification settings - Fork 9
How To Save The TimeZoneDb
Chris Dostert edited this page Jan 17, 2014
·
4 revisions
TimeZoneDb is built to be persistence agnostic. By default it will store its data in memory. If you want to save it somewhere else it's as simple as implementing two interfaces(ITimeZoneRepository and IDaylightSavingsAdjustmentRepository), and passing them to TimeZoneDbUseCases when you instantiate it, as demonstrated below.
// instantiate custom implementations of the repository interfaces
var customTimeZoneRepository = new CustomTimeZoneRepository();
var customDaylightSavingsAdjustmentRepository = new CustomDaylightSavingsAdjustmentRepository();
// this will load TimeZoneDb into custom data source
var timeZoneDbUseCases =
new TimeZoneDbUseCases(customTimeZoneRepository,customDaylightSavingsAdjustmentRepository);