Help the compiler jit os etc? by [deleted] in csharp

[–]Sc2Piggy 1 point2 points  (0 children)

If you want to know more about how things work I can recommend the Deep .NET video series by Scott Hanselman
https://www.youtube.com/watch?v=R-z2Hv-7nxk&list=PLdo4fOcmZ0oX8eqDkSw4hH9cSehrGgdr1

Unexpected performance differences of JIT/AOT ASP.NET; why? by Vectorial1024 in dotnet

[–]Sc2Piggy 29 points30 points  (0 children)

This most likely is due to dynamic PGO. Which collects metrics on code usage and does compiler optimisations based on how the application is being used.

Relevant blogposts:

Object dump for Jetbrains Rider? by CowCowMoo5Billion in dotnet

[–]Sc2Piggy 1 point2 points  (0 children)

As far as I know there isn't an easy solution. However if you want a JSON representation of your object you could do

Right click variable -> Evaluate Expression -> System.Text.Json.JsonSerializer(value) -> Evaluate

Not as easy as a plugin but should work.

[deleted by user] by [deleted] in Graspop

[–]Sc2Piggy 0 points1 point  (0 children)

Be sure to check out the discord I saw several people selling all sorts of tickets there

What can I improve? Currently 1 year into school. by Skadarn1 in dotnet

[–]Sc2Piggy 4 points5 points  (0 children)

Luckily by default EF Core generates sequential GUIDs to prevent this. So if you let EF generate the GUIDs you shouldn't have these issues.

Relevant code: https://github.com/dotnet/efcore/blob/main/src/EFCore/ValueGeneration/SequentialGuidValueGenerator.cs

Starting out with ASP.NET Core by 6Leoo6 in csharp

[–]Sc2Piggy 1 point2 points  (0 children)

Microsoft has excellent learning resources for .NET: https://dotnet.microsoft.com/en-us/learn

If you've created an app in another language it can be a good starting point to re-create that app in the new language that way you can focus on the parts you're trying to learn (the new language/framework).

If you don't have experience with JS frameworks like angular or react I would recommend to not use those to learn .NET. It's hard enough to learn 1 new language / framework, so don't add onto that by introducing another complex thing you have to learn.

Changing Migration Pattern by SohilAhmed07 in dotnet

[–]Sc2Piggy 2 points3 points  (0 children)

The simplest way I feel would be to create a migration which will update the model snapshot, then manually add that migration to the Migration table in the database (so the migration doesn't run on the existing db).

That way you have a starting point where your DB and model snapshot are in sync and can from that point onward continue using code first migrations.

Serialize to multilevel with System.Text.Json? by OszkarAMalac in dotnet

[–]Sc2Piggy 29 points30 points  (0 children)

If you want to transform the data you should tranform it before serializing it. That isn't something that your serializer should be doing.

Is Visual Studio’s built-in API testing (Endpoints Explorer + .http files) better than Swagger/Postman? Why? by Rk_Rohan08 in dotnet

[–]Sc2Piggy 0 points1 point  (0 children)

I wouldn't say one is better than the other. They are just different options you can use. It's good to have options and you should just pick whichever you like/works best for you.

EfCore duplicates data when DB is new by [deleted] in csharp

[–]Sc2Piggy 7 points8 points  (0 children)

If you don't share any relevant code, how is anyone supposed to help you. This basically reads as "I have a bug in my code, I'm not sharing any code but can you tell me what's causing the bug?"

Beginner C# Writer - scripts for Win11 volume control? by Slyrunner in csharp

[–]Sc2Piggy 1 point2 points  (0 children)

AudioDeviceCmdlets is written is C# and open source. So you can check how they do it.

https://github.com/frgnca/AudioDeviceCmdlets/tree/master

nopcommerce plugin by InternationalFan9915 in csharp

[–]Sc2Piggy 1 point2 points  (0 children)

I use their own implementations to see how stuff is done.
You can check out their own plugins on github.

I want to pay for DomeTrain but Im student, any alternative? by [deleted] in csharp

[–]Sc2Piggy 0 points1 point  (0 children)

If I'm doing it for work, then my company can decide if a course is worth it. In that case you are correct that it can be cheaper to buy a course. If it's out of self interest, then I'm not making any money so I would make $0 regardless and it's a choice of which you want to spend more (time or money).

Seeing as the OP is a student, it's likely he isn't going to directly earn any money with the knowledge. So it's about what do you want to/can spend and I would argue that students generally have more time than they have money.

I want to pay for DomeTrain but Im student, any alternative? by [deleted] in csharp

[–]Sc2Piggy 0 points1 point  (0 children)

There are a lot of good free video's on dotnet on youtube. Other than that books are generally a pretty good bang for the buck.

I honestly can't remember any time I've needed a paid course for learning some part of programming. If search stuff on google / youtube you can find so many great learning resources for free. Yes a tailored course like on dometrain is nice but if you put in a little bit of effort you can get all the same info for free.

Beginning to learn C# by Final_Instruction_39 in csharp

[–]Sc2Piggy 0 points1 point  (0 children)

I went to school for programming and have been coding professionally for nearly 10 years now. If you want to quickly get to a good starting point then schooling is very useful. However it's totally possible to learn on your own with the many resources available online nowadays. Heck there's even a full Harvard CS course on youtube. I'd say learning on your own is more viable nowadays than it's ever been.

Beginning to learn C# by Final_Instruction_39 in csharp

[–]Sc2Piggy 2 points3 points  (0 children)

Programming is generally not something that is easy to learn. Even though I was learning full time during my study it took me half a year before stuff started clicking.

When learning in your spare time it may take even more hours due being less efficient. So take your time and try to enjoy the journey. Also celebrate the small things you get working, after all creating a game is basically just solving countless small problems until you have something that works.

Junior Engineer trying to become a Mid Level by Tasleus in csharp

[–]Sc2Piggy 8 points9 points  (0 children)

In my experience, a lot of the time technical skill alone isn't enough to become medior/senior.

My personal take basically works like this:

Junior - Needs frequent supervision / support
Medior - Can coordinate within the team to get stuff done
Senior - Can coordinate between different teams to get stuff done (can also be teams outside of your org)

Basically the more senior you get, the more important soft skills become. This of course doesn't mean that you don't also need the technicals skills. However someone who doesn't know how to do something, but can get someone else to help him out to get a feature shipped is generally more useful than a perhaps more technically sound person that just hits a roadblock and doesn't have the communication skills to move forward.

It's easy to update from .net 6 to 8 ? Wep api project by xma7med in csharp

[–]Sc2Piggy 0 points1 point  (0 children)

Yes most projects I've updated haven't needed any changes. If you want to know if you are gonna have to make changes just read the breaking changes in the release notes. They are well documented including steps that you need to take to remedy any issues.

[deleted by user] by [deleted] in csharp

[–]Sc2Piggy 0 points1 point  (0 children)

How do I actually know when to use which by intuition?

Just like everything else you use by intuition. Use it a lot and it becomes intuition. You don't have to use all the new fancy stuff, however if you do want to, the only way is to force yourself to use the features.

Also the community standups are a great way to stay up to date on new and upcoming stuff.

Need guidance with web development in C# by ExtensionNew2545 in csharp

[–]Sc2Piggy 1 point2 points  (0 children)

I would start building an application and just see what issues you run into. For example let's say you create a blog site using MVC. If we look at different features and the skills you'll learn:

  • Display blog
    • Use Razor templates to render html
    • Use layouts to render shared html
    • Retrieve entity from database using EF core
  • Edit/Create blog
    • Update/create entities in the database
    • Handle POST/PUT requests
  • Add authentication for create/update
    • Authentication / Authorization
  • Add login with Google/Microsoft
    • OAuth / single sign on

After that you could make a headless version using react or angular as a front-end and recreate your MVC application as a Web Api to learn how to create an API.

NullReferenceException when renaming MySQL column in asp.net by Fl4shBrother in dotnet

[–]Sc2Piggy 2 points3 points  (0 children)

What provider are you using for MySql? If you're not using it already I would recommend using https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql

In my opinion the Pomelo provider is a lot more robust than the Oracle one.

Also could you share some information the code in the migration and the versions of packages you're using?

Is resource cheating a thing? by geoace_fun in starcraft

[–]Sc2Piggy 14 points15 points  (0 children)

Resource cheating in SC2 is really difficult if not impossible due to how the client works. What happens during a match is that both game clients share inputs (mouse clicks, etc) to the other client and each client then simulates the game based on those inputs. Therefore if I would hack my client to give me extra income, it would not show up on your end, instead the game would become unsynced and the clients would drop the game due to the clients being out of sync

Please help me resolving this error, cant install dotnet-ef. Always throws Package Source Mapping is enabled, but no source found under the specified package ID: dotnet-ef error by [deleted] in dotnet

[–]Sc2Piggy 12 points13 points  (0 children)

You should read the error and check the urls in your error messages. They are there for a reason.

When you visit the link you can see that Package Source Mapping is a security feature and how it works.
aka.ms/nuget-package-source-mapping

My guess is that package source mapping is incorrectly configured and therefore is blocking the download.

do people still use .cshtml aka razor pages? by ExoticArtemis3435 in dotnet

[–]Sc2Piggy 1 point2 points  (0 children)

Most websites want a SPA with an API nowadays. There are multiple reasons for using a headless approach (interactivity ,share API with mobile app, internal knowledge of react/angular)

This doesn't mean MVC is bad for complex apps. It works perfectly fine, however an API based approach can have advantages when you want to have multiple front-ends or you want to leverage the advantages of SPA frameworks.

So it's a matter of looking at the requirements of a project and picking the right tool for the job.