public MatsAction StartMsalAction(MatsScenario scenario, string correlationId, IEnumerable <string> scopes)
        {
            var actionArtifacts = CreateGenericAction(scenario, correlationId, ActionType.Msal);

            actionArtifacts.PropertyBag.Add(ActionPropertyNames.IdentityServiceConstStrKey, MatsConverter.AsString(IdentityService.AAD));
            SetScopesProperty(actionArtifacts.PropertyBag, scopes);
            return(actionArtifacts.Action);
        }
        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));
        }