Welles
Welles
Explore posts from servers
CC#
Created by Welles on 4/25/2023 in #help
❔ GraphServiceClient proactive installation to group chat
All, I was wondering if there was a way to proactively install your bot into a group chat when only knowing the name of the groupchat? Much like I’m doing with users, at the moment I find the userid with graph api client, then use that userid to install the bot using the graphql client. Best regards!
2 replies
CC#
Created by Welles on 10/26/2022 in #help
Fastest way to change all items in a nested list
Hi all, So atm I serializing following json string into a list:
[
{
"Tag":"Tag1",
"Categories":["A","B"]
},
{
"Tag":"Tag2",
"Categories":["A","B"]
}
]
[
{
"Tag":"Tag1",
"Categories":["A","B"]
},
{
"Tag":"Tag2",
"Categories":["A","B"]
}
]
What would the fastest way be to change all category string to lower case? I'm using a nested for loop now after serialization. Best regards!
8 replies
CC#
Created by Welles on 10/24/2022 in #help
azure functions isolated process
Hi all, This is a niche question, but hoping somebody could enlighten me. So I’m creating an azure function in visual studio (isolated process) and had some questions on the workings of the hostbuilder in this particular case. I noticed that all Functions you create using the [Function …] tag are injected as transient, is there a way to change this or is it just how the azure functions sdk works? Secondly I’m trying to get serilog working for my local development, the issue I’m having is that when running the code from vsstudio, the actual cmd window which shows does not actually listen to stdout and thus my serilog config using sink console shows nothing. When I remove serilog config in configurelogging, the logs show up but are not formatted the way I want and I can’t seem to change that. Best regards!
2 replies
CC#
Created by Welles on 9/22/2022 in #help
.net core webapi2 API key authorization
I was wondering what the absolute best practice was to implement API key authorization for your controllers? - Using middleware (as I'm doing now) - Using Authentication Filters (api key is not really authentication) I'm guessing that if I need only a couple endpoints to be secured I need to use filters, if not I can use middleware? Best regards!
44 replies
CC#
Created by Welles on 9/15/2022 in #help
asp.net core services initialization
Hi there, Was wondering what the best way is to go about initializing services I add to my asp.net builder. The initialization code needs to run async methods, so the constructor is not an option here unless I do some weird stuff. Best regards!
32 replies
CC#
Created by Welles on 9/12/2022 in #help
Serilog per sink and per log type loglevel override
Hi there, Was wondering if it was possible to set an override per log type for each sink specifically. E.g. Console log should be "Microsoft.Hosting.Lifetime": "Information", "Microsoft.Extensions.Hosting": "Warning", "System.Net.Http.HttpClient.Refit": "Warning", "Microsoft.Extensions.Http":"Warning" and File log should be "Microsoft.Hosting.Lifetime": "Information", "Microsoft.Extensions.Hosting": "Information", "System.Net.Http.HttpClient.Refit": "Information", "Microsoft.Extensions.Http":"Information" Best regards!
2 replies
CC#
Created by Welles on 9/6/2022 in #help
Vscode and local reference to dll
So I built a package that I want to reference in vscode. I copied the DLL, added the reference de csproj and restored the project. Now the first time everything worked, however when updating the package with new methods and doing the same copy + restore, the new method is not found. Using omnisharp in a devcontainer. Seems like something is cached somewhere or something.
28 replies