-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ODS-5298] Improve Error Reporting for Bad Connection String (#453)
* Fix admin and security database initializers * Add Lazy to the security repository * Fix unit tests * Update reference to DataAccess admin & security * Fix Postman tests * Update reference to DataAccess admin & security
- Loading branch information
1 parent
d4b6ebb
commit 4cb58ff
Showing
10 changed files
with
160 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
Application/EdFi.Security.DataAccess/Utils/ResettableLazy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
|
||
namespace EdFi.Security.DataAccess.Utils | ||
{ | ||
public class ResettableLazy<T> | ||
{ | ||
private readonly Func<T> _valueFactory; | ||
private Lazy<T> _lazy; | ||
|
||
public bool IsValueCreated => _lazy.IsValueCreated; | ||
public T Value => _lazy.Value; | ||
|
||
public ResettableLazy(Func<T> valueFactory) | ||
{ | ||
_valueFactory = valueFactory; | ||
_lazy = new Lazy<T>(_valueFactory); | ||
} | ||
|
||
public void Reset() | ||
{ | ||
_lazy = new Lazy<T>(_valueFactory); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters