Strawby
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
Right, there already were some hiccups when implementing some of the parts I already have for those.. I do (as of now at least) only really use the name, namespace and some other trivial information that should be part of either of the APIs.. though it'd prolly be smart to re-think if doing that is worth it
36 replies
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
Oh, yeah - that is not for the assertions in the test, but the source generator itself. I run into the "issue" when running the generator in a test, using this setup
36 replies
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
Hi Fred,
Thanks for the quick reply! It could very well be that I'm doing something completely wrong here, I was just lead here by something else I've been working on, and that seemed like a sensible way to go about it..
I get the full name name (e.g. without namespace or anything if specified) to compare against the actual type - I know this is prolly not the most efficient way, but it's what I was going with to start off :P I use it like this:
https://github.com/StrawbrryFlurry/mumei/blob/7c0cb2ffac9e77c9f80b079f0e3abf5fc10bf56c/src/Mumei.Roslyn/Extensions/MemberDeclarationSymbolExtensions.cs#L18C8-L18C8
Here:
https://github.com/StrawbrryFlurry/mumei/blob/7c0cb2ffac9e77c9f80b079f0e3abf5fc10bf56c/src/Mumei.DependencyInjection.Roslyn/ModuleMumeiGenerator.cs#L33
Note that this is all still very very much WIP ^^"
The idea is that you can run a test on the source generator with a relatively simple fluid interface like this:
https://github.com/StrawbrryFlurry/mumei/blob/7c0cb2ffac9e77c9f80b079f0e3abf5fc10bf56c/test/Mumei.DependencyInjection.Roslyn.Tests/MumeiModuleGenerator.cs#L37
SymbolInfo
from an attribute in order to get it's SourceGeneratorTest
is here https://github.com/StrawbrryFlurry/mumei/blob/7c0cb2ffac9e77c9f80b079f0e3abf5fc10bf56c/test/Mumei.Roslyn.Testing/SourceGeneratorTest.cs36 replies
❔ Generic entity type in EF Core
That was the initial idea but the data is fetched by a "cron job" from a different container and needs to be persisted somewhere for a different job to pick up. We could look into just caching that as raw json in smth like redis but there's no redis instance for that deployment right now and I'm supposed to use the db if I needed to persist data
44 replies
❔ Generic entity type in EF Core
I mean, I can still look into a type per table solution once I actually have to query trough the data but as long as that'd not the case that doesn't seem worth the extra effort. Also, the data being stored there is really short lived e.g. will be updated every few hours so having some inconsistencies with the serialized type doesn't seem like a huge issue to me
44 replies
❔ Generic entity type in EF Core
I might just serialize the data myself for now and just track the type with the entity. Seems like the feasible solution without having to create tons of tables that I'm not really gonna need for now. Like I said, I don't actually want to query the data, just retrieve a list of all "metrics" of a certain type. So that should work well enough for now
44 replies
❔ Generic entity type in EF Core
Hmm yeah would prolly have to do some table per type thingy.. I'll have to see how efcore behaves if I register multiple configs with the same generic type definition but other arguments Maybe I'll still need to make a constructed type for each. I Could probably dynamically create them but that seems like a really bad workaround
44 replies