Thanks a lot Julio for the course 👍 What is OwningComponentBase in .Net 9 ? and how to use it? When to use IDisposable over IAsyncDisposable and vice-versa? Is any razor component will be disposed automatically after leaving the page?
I had an issue where I received a NullReferenceException when attempting to run the GET /games request When adjusting MapGet, the Include method can apparently come from either System.Data.Entity or Microsoft.EntityFrameworkCore. Both were suggested to me by Visual Studio, and I arbitrarily chose System.Data.Entity, which caused Genre to be null when queried from the database which promptly caused the null reference exception when creating the GameSummaryDTO. Using Microsoft.EntityFrameworkCore fixed the issue. I don't know enough to know why one worked and the other didn't, but I'm posting this here in case anybody experiences the same issue.
What an amazing course - really awsome. I can't seem to get to modal working though (I am using Visual Studio 2022, not VS Code). Nothing happens, when I click the delete-button. Anyone?
Hello Julio, When I open a new terminal and I write dotnet -- version, the response is : Zsh: command not found : dontnet I am working on a mac book I don't know if it change something.
Hi Julio, great course, I really enjoyed it and was able to reproduce it following the steps! I was wondering if there is different material or extra material in the paid course?
I'm glad it helped. The paid course includes the slide decks as printable handouts, a break down into 5-7 min lessons, snapshots of the source code on every lesson and quizzes at end of each module.
12:05 You should do an update for API because .NET9 removed Swagger. 15:22 REST Client 22:04 Reference 33:09 Unit Test namespace WebAPI; public class WeatherForecast { public DateOnly Date { get; set; } public int TemperatureC { get; set; } public string Summary { get; set; } = string.Empty; public string Season { get; set; } = string.Empty; } using System; namespace MainClassLib; public class WeatherCalc { public static string GetYearSeason(DateOnly date) { int month = date.Month; return DetermineSeason(month); } public static string DetermineSeason(int month) { return month switch { 12 or 1 or 2 => "Winter", 3 or 4 or 5 => "Spring", 6 or 7 or 8 => "Summer", 9 or 10 or 11 => "Fall", _ => "Invalid Month" }; } } using MainClassLib; using Microsoft.AspNetCore.Mvc; namespace WebAPI.Controllers; [ApiController] [Route("[controller]")] public class WeatherForecastController : ControllerBase { private static readonly string[] Summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; private readonly ILogger<WeatherForecastController> _logger; public WeatherForecastController(ILogger<WeatherForecastController> logger) { _logger = logger; } [HttpGet("GetWeatherForecast", Name = "GetWeatherForecast")] public IEnumerable<WeatherForecast> Get() { return Enumerable.Range(1, 5).Select(index => new WeatherForecast { Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), TemperatureC = Random.Shared.Next(-20, 55), Summary = Summaries[Random.Shared.Next(Summaries.Length)], Season = WeatherCalc.DetermineSeason(DateOnly.FromDateTime(DateTime.Now.AddDays(index)).Month) // Correctly setting the season }) .ToArray(); } [HttpGet("GetYearSeason", Name = "GetYearSeason")] public string GetYearSeason([FromQuery] DateOnly date) { return WeatherCalc.GetYearSeason(date); } }
1:52:16 Build errors, the form fields attempting to access game fail to find any of its properties. dot syntax works, autofill works, no errors indicated in the file, @using Model is where it should be. Am I cursed or what could be wrong? Game variable in @code section has 6 references exactly as in the video. Unlike in your demonstration, the color of game in @bind-Value="game.Name" is orange, not blue. The variable part '.Name' is blue.
1:43:25 why do you declare the "game" variable as a property with {get; set;} but declare genresClient a few minutes later as a field (without getter and setter)? How do I know when to declare as which?
Came here from the minimal api course ,Thank you so much for such an amazing course god bless you. I also have a small question iam still going to look in to it later once iam done but for now can you tell me why we are using a string for the genre Id specifically we can use an int for it right?
2:05:55 I had to output in "Data/Migrations" instead of "Data\Migrations" as shown in the tutorial, because it created a folder outside of the "Data" folder. 2:12:06 I was unable to open the GameStore.db file with the SQLite extension. I then reinstalled the extension, however it errored out saying - 1. "SQLite process failed to start: The argument 'file' cannot be empty. Received" and 2. "Unable to find a valid SQLite command, Fallback binary is not valid." Then I had to search the internet and was able to solve it. I had to install sqlite in my system. I was using Debain so I had to do `sudo apt install sqlite3` and restarted VSCode.
Hi! I had errors like "System.TypeInitializationException: The type initializer for 'Microsoft.AspNetCore.Components.Forms.InputNumber`1' threw an exception. ---> System.InvalidOperationException: The type 'System.String' is not a supported numeric type." when trying to open "localhost:5095/editgame". I fixed my problem by using @ before "game" in the bind-Value like this: <EditForm Model="@game" FormName="editGame"> <div class="mb-3"> <label for="name" class="form-label">Name:</label> <InputText id="name" @bind-Value="@game.Name" class="form-control" /> </div> <div class="mb-3"> <label for="genre" class="form-label">Genre:</label> <InputSelect id="genre" @bind-Value="@game.GenreId" class="form-select"> <option value="">Select a genre</option> @foreach (var genre in genres) { <option value="@genre.Id">@genre.Name</option> } </InputSelect> </div> <div class="mb-3"> <label for="price" class="form-label">Price:</label> <InputNumber id="price" @bind-Value="@game.Price" class="form-control" /> </div> <div class="mb-3"> <label for="releaseDate" class="form-label">Release Date:</label> <InputDate id="releaseDate" @bind-Value="@game.ReleaseDate" class="form-control" /> </div> </EditForm> In case someone else has the same problem.
i just quit jetbrains (too expensive), didnt want to go back to visual studio 22. vscode has been amazing!! what i was using for jetbrains i now pay for copilot! thanks for this!