antimatter8189
Any WinForms gods here? Having issues with the Editor Attribute
I am encountering an issue with a software project restructuring. Initially, my solution combined server classes and UI components in a single project. To improve the architecture, I separated these into distinct UI and server projects. However, this has led to a challenge: the server can no longer directly access the UI.
To elaborate, in the original setup within a unified project, I had 'ClassA' inheriting from 'UITypeEditor'. 'ClassB' utilized the attribute Editor[typeof(ClassA), typeof(UITypeEditor)].
Now, with 'ClassA' residing in a different project, I created 'ClassC' which inherits from 'ClassB' and also applies the Editor[typeof(ClassA), typeof(UITypeEditor)] attribute. The issue arises when implementing this change: the 'EditorBaseTypeName' returns as 'string' instead of the expected 'assemblyQualifiedName'.
I am seeking suggestions for addressing this problem. It's also worth noting that these properties lack setters, so overriding them is not an option
1 replies
❔ Losing bytes when delivering dynamic object via RabbitMQ
Hey there got a bit of a complex problem.
Got this code:
Before when i tried to send the ExpandoObj itself all worked well.
Now Im sending a lift of objects the above methods produces using rabbitmq.
when i seralize i got a 1500 bytes messege size, when i recive the messege its only 120 bytes.
Any ideas what could be wrong?
11 replies
❔ How to force enumaration on ExpandoObj?
Hey guys, i encountered a situation where i have this ExpandoObj
I need to enumerate its properties (so it doesnt deffer execution on some event i have)
Problem is, nothing seems to work.
tried using like aka :
In addition tried going over the expandoobj with
And still when I hover over the objectList i get a "result view" and "dynamicview" which means it hasnt been enumarated.
3 replies
❔ .Net Logging - Is this valid?
So i saw this nick chapsas short and I've too passed my message as a string(big error) into the logger.
Aka this one:
(60 sec video)https://www.youtube.com/shorts/PvQGVmozCdU
So I've changed my method to do this:
Calling it like this:
Wanted to make sure this is correct and am not shooting myself in the foot
97 replies
❔ Ef core-Odd Behavior
So straight into it,
The mapping:
builder.Entity<LessonPhase>(b =>
{
b.ToTable(lingumindConsts.DbTablePrefix + "Phases", lingumindConsts.DbSchema);
b.HasOne(x => x.BotInitialInteraction).WithOne(x => x.LessonPhaseForInitial)
.HasForeignKey<BotInteraction>(x => x.LessonPhaseForInitialId);
b.HasOne(x => x.BotFinalInteractionOnSuccess).WithOne(x => x.LessonPhaseForOnSuccess)
.HasForeignKey<BotInteraction>(x => x.LessonPhaseForOnSuccessId);
b.HasOne(x => x.BotFinalInteractionOnFailure).WithOne(x => x.LessonPhaseForOnFailure)
.HasForeignKey<BotInteraction>(x => x.LessonPhaseForOnFailureId);
b.HasMany(x => x.UserInteractions).WithOne(x => x.LessonPhase).HasForeignKey(x => x.LessonPhaseId);
});
The Class:
The Code:
Basically After saving to the DB, the last phase, lets say number 6, The InitialBotInteraction string value becomes the same as the BotFinalInteractionOnSuccess string,
Only happens on the last phase all the others are fine, so the heck is going on?
31 replies
❔ Advice on data modeling
So basically I've got this fat object called lesson,
Each lesson has phases, which is basically a question
Howerver such a situation can occur:
So each phase has user answers, I will add a collection of Bot Responses,
How do I tie these 2 together? so they know the order and what they belong too?
Any advice is welcome.
using Ef core btw
3 replies
❔ Whats the feature called?
I remember seeing a nick chapsas video where you can specify the string type for the Ide and get assistance from the ide and error highlighting,
if the string is a json you declare it so and it knows how to work with it, its not raw string literals
5 replies
❔ How does one hold a value in a private field in a controller?
So basically controller gets created for every request right?
Problem is i have this field:
And i set it once the user creates a new lesson.
However if you call another endpoint that uses that variable it becomes null,
static wont do either as i read.
So how do you approach this?
113 replies
❔ Advice on Data modeling-ef core
Basically I've got a lesson which is an aggregate root, On said lesson i got phases and each phase has an answer.
I want to be able to save past answers aswell to analyze.
Current Code:
So I've come up with 2 approaches:
1.A phase will contain a list of answers and we will only load the last added to the db when making calls, Was unsure how to do it and Chat-gpt gave me this:
2.create a new entity named pastAnswer that sits on Phase, but doesnt load it except for when we want to load it for something
And when the user submits a new answer, it gets saved as a past answer, and the new answer becomes the user answer
9 replies
❔ Troubleshooting EF Core: Error Message - INSERT Statement Conflicts with FOREIGN KEY Constraint
Hey there facing an issue,
I got a lesson entity that contains a List of questions.
Mapping is done like this:
I am getting an exception when attempting to insert a new lesson, and my assumption is that the foreign key constraint on the questions array is failing because the lesson does not yet have an ID. As a result, the questions array is missing the required foreign key reference to the newly created lesson. Here is an example of the JSON data I am using:
Method like this:
4 replies
❔ Using mvvm toolkit- Why my view has no access to my command?
I got the following Code in the view model:
And the view:
I got a few button on the view, when it try to give the button a command to CalculateAndSave, method isn't available, is my binding wrong?
124 replies
❔ How to use the Azure function I built to retrieve the connection string? cant puzzle the pieces.
I have this function:
The connection string is stored in the local.setting.json file in the function project.
My question is how do I use this:
To read it?
Do I understand correctly that I can store the access information there?
I saw something about creating environment variables in azure and reading it with the function, not sure what's correct.
Any advice would be appreciated
4 replies
❔ One my my azure account not identified as one?
Hey there, I'm having an odd issue with my Azure account. I have two accounts linked to my Visual Studio, the main one which contains all my resources, and a dummy one which I created to check the issue. When I try to publish, I can switch between the two accounts, and the dummy one works just fine. However, the main one keeps telling me I need to sign in with an Azure account.
I'm puzzled as to why this is happening. Can anyone provide any insight or suggestions for resolving the issue?
I've already tried signing out of Visual Studio and signing back in with my main Azure account, but the problem persists. If anyone has any solutions, I would greatly appreciate your help. Thank you in advance!
2 replies