Issue How can I host the published result of this simple tutorial in IIS? Is there guidance on how best to accomplish this? The solution contains an ASP.NET Core Web API project (backend) and an Angular project (front-end). It works
Continue readingTag: asp.net-core-webapi
[SOLVED] Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<CommandAPI.Dtos.CommandReadDto>' to 'Microsoft.AspNetCore.Mvc.ActionResult
Issue Every time I test for the target action: GetAllCommands(), I face this error! Here my code: [HttpGet] public ActionResult<IEnumerable<CommandReadDto>> GetAllCommands() { var commandItems = _repository.GetAllCommands(); return _mapper.Map<IEnumerable<CommandReadDto>>(commandItems);//error-pane code } But when I return the result set as follow, it
Continue reading[SOLVED] How to run a .net core web api locally on Docker?
Issue I’ve created a web api that I can run locally in Visual Studio on localhost and I can access Swagger via. http://localhost:5000/swagger/index.html. I’ve created a Dockerfile and executed docker build -t test . and I can see the image
Continue reading[SOLVED] Get different results with the same query in T-SQL and LINQ (EF Core)
Issue I’m trying to retrieve records from a database in Azure and for the checks I run T-SQL queries directly and then pass them to LINQ against the EF Core context, but I’m running into this problem. select FechaOrientativa,id, Archivo,
Continue reading[SOLVED] adding a web app project to my solution, and the other projects in the solution already use .net framework, can I use .net core for the new project?
Issue Ive build out a service as a console application, it exists across 2 different projects in the solution, both are in .NET framework. I am wanting to add in an api level to this and am wondering if I
Continue reading[SOLVED] How to save an httpOnly cookie in an Angular application
Issue I’m trying to save an httpOnly cookie returned by an ASP.NET Core API with a jwt token in an Angular application, but as far as know (and I could verify that with some tests), it is not possible to
Continue reading[SOLVED] When I updated data with the same email, it shows the email already exist. How can I solve it in .NET Core?
Issue I am trying to make a API using mongodb and .NET Core. But I face a problem while updating the value. I wrote a custom validation like this: public class EmailUserUniqueAttribute : ValidationAttribute { protected override ValidationResult IsValid(object value,
Continue reading[SOLVED] .NET 6 Web Api Project No 'Access-Control-Allow-Origin' header is present on the requested resource
Issue I have a simple javascript app calling a .NET 6 Web API In the program.cs file, I have added builder.Services.AddCors and app.UseCors as below. But I still get CORS error when making a POST Request: Access to XMLHttpRequest at
Continue reading[SOLVED] Upload file into ASP.NET Core Web API
Issue We have a front-end flutter application, which should send file to our backend (ASP.NET Core Web API). The question is: how should controller be constructed? I believe that it should be a POST-method, but how to get this file
Continue reading[SOLVED] How to upload pictures in ASP.net Core Web API and Angular 13
Issue I need to save pictures in the file directory. Data is already being saved in the database. But I want to save an image. I do not have a proper understanding of that Angular Form <form [formGroup]="myForm" (ngSubmit)="submit()"> <mat-card>
Continue reading