Exi
Exi
CC#
Created by Exi on 12/9/2023 in #help
✅ Blazorserver - Value after manual db-update not changing after new fetch
Hello, I setup a blazorserver project and implemented a db connection and wanted to load user data. Problem: My user table has a column called "IsActive" (bit). Now I fetch a record from a user where the IsActive = 0 and my response user property IsActive = false - so far so good. Now I manually update the IsActive value on the database to 1 and call the function again to fetch the new information. Using EF Core btw ... if I run the query which is sent to the sql data provider I get the correct result with isactive = 1, but if I log the response user, the property IsActive is still false. After I stop the program and restart it, the data gets fetched correctly. It feels like it get cached or smth, no idea why it wont update the value it gets from the query. Anyone can give me some hints or the solution to this? I've read smth about ChangeTracking and used AsNoTracking() but that didnt help. Code Parts:
readonly ApplicationContext _database;
public UserRepository(ApplicationContext database)
{
this._database = database;
}

var user = await _database.Users.FirstOrDefaultAsync(u => userId > 0 ? u.UserId == userId : u.Email == email);
Console.WriteLine($"Email: {user!.Email}, IsActive: {user.IsActive}");
readonly ApplicationContext _database;
public UserRepository(ApplicationContext database)
{
this._database = database;
}

var user = await _database.Users.FirstOrDefaultAsync(u => userId > 0 ? u.UserId == userId : u.Email == email);
Console.WriteLine($"Email: {user!.Email}, IsActive: {user.IsActive}");
1 replies
CC#
Created by Exi on 12/3/2023 in #help
BlazorServer Saving TabData from different tabinstances
Heyo, I'm having a blazorserver app and you're able to switch between different tabs (loading different components). Now I'm thinking about ways to save the data (temporary userinput without saving to persist) to keep that in cache in case the user switches between tabs. basically like the browsers does - he starts to fill some forms and switches to another tab to check something and then back to the first tab and continues where he left (without starting from the beginning). how would you usually realize that? could also happen, that he opens the same component in multiple tabs. I thought about working with localstorage and adding unique guid each tab / instance, but are there better ways? Thanks for your input and sorry for my english^^ Exi
1 replies
CC#
Created by Exi on 11/3/2023 in #help
✅ Embed ConsoleApplication In BlazorWasm ClientPage
Hey, I was wondering if its possible to embed a console application in my frontend. Right now I start that console application via client and it opens a new window on the server. My dream scenario would be to embed that window into my client page and dont open a "new console window". Only input to that console would be any char at the end to close the console / finish the process. It gets started with some arguments and just does the stuff and I show the console to see whats going on there.. (I dont have access to the sourcecode of the console app, thats 3rd party stuff) Is that even possible and any thoughts about that? Kind regards Exi
6 replies
CC#
Created by Exi on 10/24/2023 in #help
✅ .NET7 Hotfix via DDL
Hey, I've following situation and question: Currently there is a external software in use and sometimes it got some hotfixes and those got delivered by DLLs. Those just got added to the version and it worked. Now they migrated the software to .NET7 and only deliver the hotfix as whole softwarepackage and not only the DLL. reasoning: the versioncontroll (assembly integrity I assume? they called it versioncontroll) of .net 7 is higher than before and you cant just add new dlls. Is there any workarround or is that just how it is? Maybe anyone can give me some information about that topic and insights (or helpful links where I can read more about that) Thanks
86 replies
CC#
Created by Exi on 10/23/2023 in #help
✅ T-SQL Statement in Linq
No description
110 replies
CC#
Created by Exi on 10/16/2023 in #help
✅ await in computed property?
hello, i have my blazorwasm app and a razorpage with a few checkboxes. if I check or uncheck a checkbox I want to call a function to fetch data. my component (mudblazor): <MudCheckBox @bind-Checked="@missing_column_statistics" Label="missing_column_statistics" Color="Color.Primary"> </MudCheckBox> private bool _missing_column_statistics = false; public bool missing_column_statistics { get => _missing_column_statistics; set { _missing_column_statistics = value; SearchExtendedEvents(); // he wants await here } } my SearchExtendedEvents is a async task (public async Task SearchExtendedEvents()) and because of that its crying for await but I cant just add it. I've googled a little bit and found smth like that: set { _optimizer_timeout = value; new Task(async () => { await SearchExtendedEvents(); }).Start(); } but idk if thats a good way to do it. Maybe my way of doing this is bad anyways and maybe someone can give me advice how to handle this. Thanks
5 replies
CC#
Created by Exi on 10/9/2023 in #help
✅ BlazorWASM Multi Tenant / Multi Tenancy
No description
68 replies
CC#
Created by Exi on 10/5/2023 in #help
❔ BlazorWASM Multi-Tenant Application - Struggle with changing DbContext while Runtime
No description
8 replies