aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/src/Models/Database/BaseWithOwner.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-12-15 08:37:57 +0100
committerivarlovlie <git@ivarlovlie.no>2022-12-15 08:37:57 +0100
commitd3a80daac492f535e36dbcb6493b84f56bbd419f (patch)
tree4ac9d7e2f453fbfad89dddd85743320a0a7fcb7a /code/api/src/Models/Database/BaseWithOwner.cs
parentacbb9c7536be32fcce1c69bfd6054149f978229c (diff)
downloadgreatoffice-d3a80daac492f535e36dbcb6493b84f56bbd419f.tar.xz
greatoffice-d3a80daac492f535e36dbcb6493b84f56bbd419f.zip
refactor: Make base classes abstract
Diffstat (limited to 'code/api/src/Models/Database/BaseWithOwner.cs')
-rw-r--r--code/api/src/Models/Database/BaseWithOwner.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/code/api/src/Models/Database/BaseWithOwner.cs b/code/api/src/Models/Database/BaseWithOwner.cs
index ad9b33a..7e9f6c1 100644
--- a/code/api/src/Models/Database/BaseWithOwner.cs
+++ b/code/api/src/Models/Database/BaseWithOwner.cs
@@ -3,10 +3,14 @@ namespace IOL.GreatOffice.Api.Data.Database;
/// <summary>
/// Base class for all entities with ownership.
/// </summary>
-public class BaseWithOwner : Base
+public abstract class BaseWithOwner : Base
{
protected BaseWithOwner() { }
+ protected BaseWithOwner(Guid createdBy) {
+ CreatedBy = createdBy;
+ }
+
protected BaseWithOwner(LoggedInUserModel loggedInUser) {
CreatedBy = loggedInUser.Id;
}
@@ -21,12 +25,12 @@ public class BaseWithOwner : Base
public void SetDeleted(Guid userId) {
DeletedBy = userId;
- SetDeleted();
+ base.SetDeleted();
}
public void SetModified(Guid userId) {
ModifiedBy = userId;
- SetModified();
+ base.SetModified();
}
public void SetOwnerIds(Guid userId = default, Guid tenantId = default) {