private ActionArtifacts CreateGenericAction(MatsScenario scenario, string correlationId, ActionType actionType)
        {
            string     actionId = MatsId.Create();
            MatsAction action   = new MatsAction(actionId, scenario, correlationId);

            string corrIdTrim = correlationId.TrimCurlyBraces();

            var propertyBag    = new ActionPropertyBag(_errorStore);
            var startTimePoint = DateTime.UtcNow;

            propertyBag.Add(ActionPropertyNames.UploadIdConstStrKey, MatsId.Create());
            propertyBag.Add(ActionPropertyNames.ActionTypeConstStrKey, MatsConverter.AsString(actionType));
            propertyBag.Add(ScenarioPropertyNames.IdConstStrKey, scenario?.ScenarioId);
            propertyBag.Add(ActionPropertyNames.CorrelationIdConstStrKey, corrIdTrim);
            propertyBag.Add(ActionPropertyNames.StartTimeConstStrKey, DateTimeUtils.GetMillisecondsSinceEpoch(startTimePoint));

            lock (_lockActionIdToPropertyBag)
            {
                _actionIdToPropertyBag[actionId] = propertyBag;
            }

            return(new ActionArtifacts(action, propertyBag));
        }
 public void EndMsalAction(MatsAction action, AuthOutcome outcome, ErrorSource errorSource, string error, string errorDescription)
 {
     EndGenericAction(action.ActionId, MatsConverter.AsString(outcome), errorSource, error, errorDescription, string.Empty);
 }