Previously I was saving the UserData using the StateClient object but since this will be deprecated I have implemented a solution that saves the ConversationData in a private database. The UserData was set outside a dialog context using the botCredentials : `
var botCred = new MicrosoftAppCredentials(
BotConfiguration.Cfg.MicrosoftAppId,
BotConfiguration.Cfg.MicrosoftAppPassword);
var stateClient = new StateClient(botCred);
BotState botState = new BotState(stateClient);
BotData botData = new BotData(eTag: "*");
botData.SetProperty<string>("LastName", lastName);
botData.SetProperty<string>("FirstName", firstName);
stateClient.BotState.SetUserData("webchat", userId, botData);
The issue is that this was done in an external controller.
How can I achieve the same results but using my custom database for storage ?
Thank you