Refactor AddedWho assignment in InsertObjectProcedure
AddedWho is now set via the AddedBy method instead of direct assignment in object initializers. The property is made internal with a private setter to prevent external modification. All ToObjectProcedure methods in insert procedure records are updated to use AddedBy for consistency and encapsulation.
This commit is contained in:
@@ -21,8 +21,7 @@ public record InsertActionProcedure : IInsertProcedure
|
||||
return new InsertObjectProcedure
|
||||
{
|
||||
Entity = "ACTION",
|
||||
Action = this,
|
||||
AddedWho = addedWho
|
||||
};
|
||||
Action = this
|
||||
}.AddedBy(addedWho);
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,7 @@ public record InsertEndpointAuthProcedure : IInsertProcedure
|
||||
return new InsertObjectProcedure
|
||||
{
|
||||
Entity = "ENDPOINT_AUTH",
|
||||
EndpointAuth = this,
|
||||
AddedWho = addedWho
|
||||
};
|
||||
EndpointAuth = this
|
||||
}.AddedBy(addedWho);
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,7 @@ public record InsertEndpointParamsProcedure : IInsertProcedure
|
||||
return new InsertObjectProcedure
|
||||
{
|
||||
Entity = "ENDPOINT_PARAMS",
|
||||
EndpointParams = this,
|
||||
AddedWho = addedWho
|
||||
};
|
||||
EndpointParams = this
|
||||
}.AddedBy(addedWho);
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,7 @@ public record InsertEndpointProcedure : IInsertProcedure
|
||||
return new InsertObjectProcedure
|
||||
{
|
||||
Entity = "ENDPOINT",
|
||||
Endpoint = this,
|
||||
AddedWho = addedWho
|
||||
};
|
||||
Endpoint = this
|
||||
}.AddedBy(addedWho);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,13 @@ public record InsertObjectProcedure : IRequest<long>
|
||||
/// </summary>
|
||||
public string Entity { get; set; } = null!;
|
||||
|
||||
public string? AddedWho { get; set; }
|
||||
internal string? AddedWho { get; private set; }
|
||||
|
||||
public InsertObjectProcedure AddedBy(string addedWho)
|
||||
{
|
||||
AddedWho = addedWho;
|
||||
return this;
|
||||
}
|
||||
|
||||
public InsertActionProcedure Action { get; set; } = new();
|
||||
public InsertEndpointProcedure Endpoint { get; set; } = new();
|
||||
|
||||
@@ -15,8 +15,7 @@ public record InsertProfileProcedure : IInsertProcedure
|
||||
return new InsertObjectProcedure
|
||||
{
|
||||
Entity = "PROFILE",
|
||||
Profile = this,
|
||||
AddedWho = addedWho
|
||||
};
|
||||
Profile = this
|
||||
}.AddedBy(addedWho);
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,7 @@ public record InsertResultProcedure : IInsertProcedure
|
||||
return new InsertObjectProcedure
|
||||
{
|
||||
Entity = "RESULT",
|
||||
Result = this,
|
||||
AddedWho = addedWho
|
||||
};
|
||||
Result = this
|
||||
}.AddedBy(addedWho);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user