Trou
Trou
CC#
Created by Trou on 9/1/2024 in #help
Server sent event & React freezing the application
In my React project, I'm using SSE to receive 10 objects per second from the server, and I'm storing these objects in the Redux store. When the data size reaches 8000+ objects, the page freezes. However, when I fetch the same data using an HTTP GET request, I can handle up to 50000 objects without any issues, and the page doesn't freeze. What could be causing the page to freeze when using SSE How can I resolve this?
4 replies
CC#
Created by Trou on 7/5/2024 in #help
✅ Return readonly property
Hello, i have a an question about returning class property as readonly(immutable) outside ? for example how to implement this C++ code in C#
const map<Command, Container>& getCommands() const { return commands }

//
auto m = c.getCommands();
m.insert(....) // error
const map<Command, Container>& getCommands() const { return commands }

//
auto m = c.getCommands();
m.insert(....) // error
here is some part of my C# code
public Dictionary<Command,Container> GetCommands()
{
return _commands;
}

privateDictionary<Command, Container> _commands;
public Dictionary<Command,Container> GetCommands()
{
return _commands;
}

privateDictionary<Command, Container> _commands;
i wanna block Add operations outside class var m = c.getCommands(); m.Add(... I searched google and stackoverflow but I couldn't find exactly I wanted, then when I asked chatgpt got anwswer that I should use IReadOnlyDictionary<T>. Is this the best practice?
3 replies
CC#
Created by Trou on 6/18/2024 in #help
Looking for Boilerplate and Learning Resources
Hello, I am a NodeJS developer. I have mostly worked with frameworks like NestJS and have had brief experience with Spring Boot. Now, I want to learn the .NET side, but unlike the others, there seems to be no similar framework. Because of this, when I examined projects, I saw that very different file structures are used even if the same architecture is used. Can you guide me to some boilerplate examples and educational content that I can use during my learning process?
40 replies
CC#
Created by Trou on 3/3/2024 in #help
C# .Net Core WebAPI Cyclic Dependancy
Hello, trying to make simple web api, have two classes Character and Episode both classes has nav property to other, wit ManyToMany relationship. The problem is when i trying to Get data json data looks like this; [ { "name": "Pika", "status": "asdasd", "species": "adasd", "gender": "Male", "image": "adsas", "episodes": [ { "name": "EP1", "airDate": "22323", "episodeCode": "asdadEP", "characters": [ null ], "id": 1, "createdAt": "2024-03-03T18:40:23" } ], "id": 3, "createdAt": "2024-03-03T17:49:17" } ] Here is my entites public class Character : BaseEntity<long> { ...SomeProps public ICollection<Episode> Episodes { get; set; } } public class Episode : BaseEntity<long> { ...SomeProps public virtual ICollection<Character> Characters { get; set; } }
5 replies