softmek
softmek
CC#
Created by XD on 11/9/2023 in #help
❔ (MVC web app) How can I handle exceptions/errors in this case?
No problem man, am off the grid! it's late 3:15am here, you can hit me up in linkedin haha, πŸ‘ŒπŸΎ
24 replies
CC#
Created by Will Pittenger on 11/9/2023 in #help
βœ… How to deserialize JSON in .NET when my base class is generic?
haha, that would be an interesting bit, i would love to chop it in my techniical field
14 replies
CC#
Created by XD on 11/9/2023 in #help
❔ (MVC web app) How can I handle exceptions/errors in this case?
No description
24 replies
CC#
Created by XD on 11/9/2023 in #help
❔ (MVC web app) How can I handle exceptions/errors in this case?
When an error occurs display the alert which will disappear in few seconds
24 replies
CC#
Created by XD on 11/9/2023 in #help
❔ (MVC web app) How can I handle exceptions/errors in this case?
24 replies
CC#
Created by Will Pittenger on 11/9/2023 in #help
βœ… How to deserialize JSON in .NET when my base class is generic?
@Will Pittenger That’s mind blowing, mastering your craft!!
14 replies
CC#
Created by XD on 11/9/2023 in #help
❔ (MVC web app) How can I handle exceptions/errors in this case?
Which FE framework are you using, i can suggest what I use
24 replies
CC#
Created by XD on 11/9/2023 in #help
❔ (MVC web app) How can I handle exceptions/errors in this case?
You can use alert message for that. Imagine all cards didn’t load, the page will be well written in red haha! πŸ˜›
24 replies
CC#
Created by XD on 11/9/2023 in #help
❔ (MVC web app) How can I handle exceptions/errors in this case?
If you get stuck, You can always reach out in my DM. especially ln
24 replies
CC#
Created by Will Pittenger on 11/9/2023 in #help
βœ… How to deserialize JSON in .NET when my base class is generic?
πŸ‘Œ sure, Appreciated
14 replies
CC#
Created by XD on 11/9/2023 in #help
❔ (MVC web app) How can I handle exceptions/errors in this case?
πŸ’― . I have over 7 year experience and that's the best way you will ever handle that, but avoid absolute url inside your application https://www.linkedin.com/in/haron-njuguna/
24 replies
CC#
Created by Will Pittenger on 11/9/2023 in #help
βœ… How to deserialize JSON in .NET when my base class is generic?
You're reconfiguring the code to handle complex JSON structures by evaluating JsonElements and introducing a more intricate class hierarchy. Using an enum to discern abstract base classes and their derived types allows for a more nuanced representation of various event information types. This adjustment accommodates additional fields in the derived types while addressing the lack of parameterless constructors, likely impacting JSON serialization/deserialization processes. Even though the system wasn't initially designed for JSON compatibility, this restructuring aligns well with the project's requirements for a demo application, providing a more tailored approach to handle diverse data structures.
14 replies
CC#
Created by Will Pittenger on 11/9/2023 in #help
βœ… How to deserialize JSON in .NET when my base class is generic?
When attempting to directly deserialize a derived generic class like ClientEventInfo using System.Text.Json.JsonSerializer, a TypeInitializationException might arise due to complexities in initializing such derived generic types. To overcome this, you can create a non-generic wrapper class for deserialization or use custom deserialization methods to handle the process, avoiding direct deserialization of the derived generic type. Alternatively, consider refactoring the classes or employing third-party libraries like Newtonsoft.Json (Json.NET) which often handle derived generic types more seamlessly during deserialization, offering a smoother and exception-free deserialization process. You can aswell desrialize to ViewModel Class..
14 replies
CC#
Created by Ahmed on 11/9/2023 in #help
❔ βœ… Mind explaining a code to me?
(int?) means it's a nullable integer value, null return emply. which means (int?) will not work for non-numerical values,
132 replies
CC#
Created by XD on 11/9/2023 in #help
❔ (MVC web app) How can I handle exceptions/errors in this case?
24 replies
CC#
Created by XD on 11/9/2023 in #help
❔ (MVC web app) How can I handle exceptions/errors in this case?
In the provided AddTransaction method, it seems there's a need for improvements related to asynchronous operations, exception handling, and code structure. Here's an enhanced version with comments to illustrate some changes:
24 replies
CC#
Created by Ahmed on 11/9/2023 in #help
❔ βœ… Mind explaining a code to me?
So, by finding the values with the closest absolute value to zero, the function determines which number or numbers are closest to zero, considering both positive and negative numbers equally in their proximity to zero. If there's a unique value that's closest to zero, the function returns that value. If multiple values share the same closest absolute distance to zero, it indicates that there's no singular closest value to zero, so the function returns None.
132 replies
CC#
Created by Ahmed on 11/9/2023 in #help
❔ βœ… Mind explaining a code to me?
No description
132 replies
CC#
Created by Ahmed on 11/9/2023 in #help
❔ βœ… Mind explaining a code to me?
No description
132 replies
CC#
Created by Ahmed on 11/9/2023 in #help
❔ βœ… Mind explaining a code to me?
look, good
132 replies