-
-
Notifications
You must be signed in to change notification settings - Fork 2
GetObjectLookup<T>: misleading parameter order — replace with GetLookupField<T> #1
Copy link
Copy link
Closed
Description
Problem
GetObjectLookup<T> has the following signature:
public T GetObjectLookup<T>(string lookupName, string objectKey, string lookupKey = null, string culture = null)The parameter order is inconsistent with GetLookup<T>(lookupName, lookupKey, culture).
Callers naturally pass the lookup key as the second argument, which silently lands in
objectKey instead — leaving lookupKey = null and causing a runtime ArgumentException.
Resolution
- Remove
GetObjectLookup<T> - Add
GetLookupField<T>with corrected, unambiguous signature:
public T GetLookupField<T>(string lookupName, string lookupKey, string fieldName, string culture = null)Usage
// Full object deserialization — unchanged
var param = GetLookup<SZWParam>("SZWParameter", "2026");
// Single field extraction — new
var rate = GetLookupField<decimal>("SZWParameter", "2026", "AwfLaag");Affected file
PayrollEngine.Client.Scripting/Client.Scripting/Function/PayrollFunction.cs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels