Aokiri ๐Ÿธ
Aokiri ๐Ÿธ
CC#
Created by Aokiri ๐Ÿธ on 11/25/2023 in #help
Difference between await & GetAwaiter()/GetResult()
I'll read about it and then modify the code.
10 replies
CC#
Created by Aokiri ๐Ÿธ on 11/25/2023 in #help
Difference between await & GetAwaiter()/GetResult()
Thanks a lot.
10 replies
CC#
Created by ๆณฃใใŸใ„ใงใ™ใ‹ on 10/29/2023 in #help
โœ… need help converting "y" or "n" response to boolean "true" or "false" in .NET 7
Oh, ok.
83 replies
CC#
Created by ๆณฃใใŸใ„ใงใ™ใ‹ on 10/29/2023 in #help
โœ… need help converting "y" or "n" response to boolean "true" or "false" in .NET 7
Like @$"All the text with any lines and etc"
83 replies
CC#
Created by ๆณฃใใŸใ„ใงใ™ใ‹ on 10/29/2023 in #help
โœ… need help converting "y" or "n" response to boolean "true" or "false" in .NET 7
You can, also, clean that code using verbatim strings.
83 replies
CC#
Created by Masimos on 10/13/2023 in #help
โ” Wanna impress my programing teacher
Every router/switch seize that kind of "pings"
28 replies
CC#
Created by Masimos on 10/13/2023 in #help
โ” Wanna impress my programing teacher
But that should be hard to do nowadays.
28 replies
CC#
Created by Masimos on 10/13/2023 in #help
โ” Wanna impress my programing teacher
Maybe he tried to tell you about a Ping to the broadcast default address.
28 replies
CC#
Created by Aokiri ๐Ÿธ on 10/13/2023 in #help
Confusion about Repository Pattern and Unit of Work.
I mainly do it to have cleaner code. Because with the Repository Pattern, even though it has the advantage of decoupling components, in the long run, I'll end up adding about 10 different repositories and having to apply each of them individually. On the other hand, with UnitOfWork, at least I can implement them all within itself and work with it. I know it has the disadvantage that, in the long run, one controller will have things it shouldn't... but at least the advantage is that the code feels cleaner. I'm not sure if this will cause me problems in the future, though...
19 replies
CC#
Created by Aokiri ๐Ÿธ on 10/13/2023 in #help
Confusion about Repository Pattern and Unit of Work.
Well, I think I'll continue learning these kinds of things in a general sense, at least to understand them... even if I don't end up using them. Thank you very much for the response, really ^^
19 replies
CC#
Created by Aokiri ๐Ÿธ on 10/13/2023 in #help
Confusion about Repository Pattern and Unit of Work.
It is supposed to have certain benefits as well as its drawbacks, but I didn't know that DbContext already comes with UnitOfWork included...
19 replies
CC#
Created by Aokiri ๐Ÿธ on 10/13/2023 in #help
Confusion about Repository Pattern and Unit of Work.
Oh, ok. Now I understand. Let me know something about the Unit of Work: how does it exactly works? I did this implementation:
public class UnitOfWork : IUnitOfWork
{
private ApplicationDbContext _db;
public ICategoryRepository Category { get; private set; }

public UnitOfWork(ApplicationDbContext db)
{
_db = db;
Category = new CategoryRepository(_db);
}
public class UnitOfWork : IUnitOfWork
{
private ApplicationDbContext _db;
public ICategoryRepository Category { get; private set; }

public UnitOfWork(ApplicationDbContext db)
{
_db = db;
Category = new CategoryRepository(_db);
}
Just passed the context and generated a new CategoryRepository object with the context as well. Also implemented a Save() method (to save changes to the db)
19 replies
CC#
Created by Aokiri ๐Ÿธ on 10/13/2023 in #help
Confusion about Repository Pattern and Unit of Work.
What's the DI? And thanks for the answer!
19 replies
CC#
Created by Moataz on 10/1/2023 in #help
โ” How to censor a bad word in capital letters without changing original letters case?
Thanks a lot!
16 replies
CC#
Created by Moataz on 10/1/2023 in #help
โ” How to censor a bad word in capital letters without changing original letters case?
How did you created those links?
16 replies
CC#
Created by Moataz on 10/1/2023 in #help
โ” How to censor a bad word in capital letters without changing original letters case?
Since Strings in C# are immutable, StringBuilder in this case can help (they're mutable)
16 replies
CC#
Created by Moataz on 10/1/2023 in #help
โ” How to censor a bad word in capital letters without changing original letters case?
You could try with StringBuilder
16 replies