/// <summary> /// Creates a new instance with the given options. /// </summary> /// <param name="options">The options for this repository.</param> /// <param name="semaphoreFactory">The semaphore factory.</param> public ConcurrentJsonRepository(JsonStoreOptions options, ISemaphoreFactory semaphoreFactory) : base(options) { var keyProperty = RepositoryKeyValidator.GetKeyProperty <T, TKey>(); GetKeyValue = keyProperty.Compile(); _semaphore = semaphoreFactory.GetSemaphore <T>(); }
/// <summary> /// Creates a new instance with the given options. /// </summary> /// <param name="options">The options for this repository.</param> public JsonRepository(JsonStoreOptions options) : base(options) { var keyProperty = RepositoryKeyValidator.GetKeyProperty <T, TKey>(); GetKeyValue = keyProperty.Compile(); }