.NET Core 3.1 MVC REST API - Full Course
Why Stack Overflow recommends it
Stack Overflow users link it as the tutorial they are following when asking about errors in their own .NET Web API projects, and answerers cite it as a starting point for building an API.
Recommended by 3 people across 3 different months, 2020 to 2023.
What it is
A 3.5 hour beginner-to-intermediate course by Les Jackson that builds a REST API in .NET Core 3.1 using MVC, the repository pattern, dependency injection, Entity Framework with SQL Server, DTOs and AutoMapper. It walks through the build step by step and ends with six CRUD endpoints.
What people said
Recommends alwn · 2020-12 · Stack Overflow · on “Newtonsoft.Json.ReferenceLoopHandling.Ignore deserialization format .NET Core 3.1”
I'm trying to make an API using .NET Core 3.1 with C# programming language which utilizes Firebase real-time database from Google through FireSharp Nu-Get package. When I ran it, I got this exception: System.Text.Json.JsonException: A possible object cycle was detected which is not supported. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32. I read here [LINK] that I can just install Microsoft.AspNetCore.Mvc.NewtonsoftJson package and ignore the reference loop handling, which works fine. But the data format looks unreadable, very hard to deserialize, and way too long: { "stateMachine": { "<>1__state": 0, "<>t__builder": {}, "bpjs": "1234
Recommends AdrianJoseph · 2021-06 · Stack Overflow · on “Automapper inner model attribute returns null”
Yes when I debug, I get a non-null value of Fish.Seller. I've updated my question for better understanding. I followed one of the tutorials from this link [this video]
Recommends Emre Utku Solak · 2021-12 · Stack Overflow · on “How to use Java in ASP.NET Core 3.1?”
An API is a medium that recieves requests from client, processes those requests inside and responds back to the client. You can probably do what you want to do by creating an API on .NET Core and consume that API in your Java project. In the simplest way, you can create an API endpoint in your .NET project's controller and send a request to that api on your Java application using the target URL of your API endpoint. The response from your API is going to be in JSON format. Please note that you can consume an API regardless of the language since the communication between your application and your API is going to be via HTTP requests and JSON responses. Some useful video links to start with: H
Cites twSoulz · 2022-08 · Stack Overflow · on “NET 6 - Entity Framework Core Error: SQL Server was not found or was not accessible”
I am creating an ASP.NET Core 6 Web API (VS 2022), and executing any controller API through swagger ui results in a connection to SQL Server error. Following this tutorial [this video] but implementing in .NET 6. Part of error log: Entity Framework Core 6.0.7 initialized 'CommanderContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer:6.0.7' with options: None fail: Microsoft.EntityFrameworkCore.Database.Connection[20004] An error occurred using the connection to database 'CommanderDB' on server 'localhost'. fail: Microsoft.EntityFrameworkCore.Query[10100] An exception occurred while iterating over the results of a query for context type 'Commander.Data.CommanderContext'. Microsoft.Data
Cites Clarissa · 2023-08 · Stack Overflow · on “Dependency injection error: Unable to resolve service for type while attempting to activate registered class”
I'm working on an ASP.NET Core Web API. When I'm executing my API with a get request, an exception is throwing before my break point: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware 1 [this video] An unhandled exception has occurred while executing the request. System.InvalidOperationException: Unable to resolve service for type 'Commander.Data.ICommanderRepo' while attempting to activate 'Commander.Controllers.CommandsController' CommandsController.cs : namespace Commander.Controllers { // Api/commands [Route("api/commands")] [ApiController] public class CommandsController : ControllerBase { private readonly ICommanderRepo _repository; //Dependency injected value public Command
Cites Clarissa · 2023-08 · Stack Overflow · on “Dependency injection error: Unable to resolve service for type while attempting to activate registered class”
@sellotape - The only interface is in ICommanderRepo.cs. I'm following along this video [this video] who built the API in .NET 3.1 but I'm using .NET 8.0.0 so I'm not sure if that will make any difference if the implementation is still fine?