superbobface
❔ .net core 6 IConfiguration Injection
Hi there - i'm going nuts try to solve this simple problem. I have a .net Core 6 WebApplication builder based app, and all i'm trying to do is get to IConfiguration in my service classes.
From what i've read, .net 6 should automatically add its IConfiguration service to the build services, and therefore my AddService<MyClass> constructor whcih has public MyClass(IConfiguration configuration) in it throws "The service implementation object was not initialized or is not available." and it's not hitting breakpoints. Remove IConfiguration from teh constructor, it works
it's like either a) IConfiguration is not injected into the services for the app builder, or b) MyClass is not subject to being DI'd by asp.net.
argh
32 replies
❔ Exclude items from linq query if they contain one from an array of substrings
I've got a list of strings, that if they appear anywhere in a linq query column i want to exclude the row. I can find loads of examples of exact matches, or where the column value appears in a list, but not the other way around, and I can't figure it out
28 replies