Strawby
Strawby
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
$close
36 replies
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
Will remember that, thanks a lot, Fred! bunnycHAPPY
36 replies
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
Haha, I can imagine that ^^"
36 replies
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
Thank you for mentioning this! It must have skipped past me and is definitely a better way of going about this then what I was doing
36 replies
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `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
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
I see.. I thought it would be a neat way of inter opting other parts of the code base that work with "regular types" ^^"
36 replies
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
<:shy_hide:809861272036311100>
36 replies
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
Yeah that's just a silly think I've toyed around with - will be thrown out / smashed into an incremental generator at some point
36 replies
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `System.Runtime` Assembly missing in `CSharpCompilation` when using referenced Attribute
No, I'm trying to build Incremental Generators.. there might be an old source generator lying around somewhere :P
36 replies
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `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
CC#
Created by Strawby on 8/23/2023 in #help
❔ ✅ `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 SymbolInfo from an attribute in order to get it's 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 SourceGeneratorTest is here https://github.com/StrawbrryFlurry/mumei/blob/7c0cb2ffac9e77c9f80b079f0e3abf5fc10bf56c/test/Mumei.Roslyn.Testing/SourceGeneratorTest.cs
36 replies
CC#
Created by Strawby on 1/15/2023 in #help
❔ Generic entity type in EF Core
I think I've got a pretty good idea what to do now. Thanks for your insights! <a:neko_nod:819942443481825350>
44 replies
CC#
Created by Strawby on 1/15/2023 in #help
❔ 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
CC#
Created by Strawby on 1/15/2023 in #help
❔ 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 think
44 replies
CC#
Created by Strawby on 1/15/2023 in #help
❔ Generic entity type in EF Core
Shouldn't be too bad if the name of a type were to change, would just leave some junk in the db or I'd have to manually clean that up.. I could prolly live with that
44 replies
CC#
Created by Strawby on 1/15/2023 in #help
❔ Generic entity type in EF Core
Yeah I'd serialize it to the full name in the current assembly
44 replies
CC#
Created by Strawby on 1/15/2023 in #help
❔ 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 Shrug
44 replies
CC#
Created by Strawby on 1/15/2023 in #help
❔ Generic entity type in EF Core
That'd need me to register them manually though, no? I'd rather not keep track of that :p
44 replies
CC#
Created by Strawby on 1/15/2023 in #help
❔ 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 shrug 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
CC#
Created by Strawby on 1/15/2023 in #help
❔ Generic entity type in EF Core
I'm not too stoked about it but I'll prolly have to go with smth like this
internal sealed class MetricsEntity : Entity
{
public string DataAsJson { get; set; } = default!;
public Type MetricType { get; set; } = default!;
}
internal sealed class MetricsEntity : Entity
{
public string DataAsJson { get; set; } = default!;
public Type MetricType { get; set; } = default!;
}
44 replies