What is the best way to design database (code first) for Asp .net core web api with multilanguage support?
My problem is: i am developing asp net core web api project, and dont have any idea how to configure api to take parameter from react side (Frontend is react), and also how can i design my database to provide my entities to front end in multiple language.Thanks for your help in advance!
What is _Layout.cshtml.css and how is it linked to the view?
In the latest ASPNET Core 8.0 I saw this file is created
During Login facing a problem where result is showing not allowed
public async Task Login(LoginViewModel model)
{
try
{
SignInResult result = await _signInManager.PasswordSignInAsync(model.UserName, model.Password, true, lockoutOnFailure: true);
if (result.Succeeded)
{
var user = await _userManager.FindByNameAsync(model.UserName);
asp-route-memberId being generated as query parametr instead of route one
In ASP.NET Core 5, when I used asp-route-...
I could get the URL like this: /Member/Update/2
. But now it is generated like this: /Member/Update?memberId=2.
I don’t understand what changed in 8.0 that makes me include it in my [HttpGet]
as [HttpGet("Update/{memberId}")]
. I am feeling like something is missing. Do I remember it wrong, or did they change it in newer versions? Is there any other way to change this behaviour?
ASP NetCore app work locally, returns 404 in docker container
gameshelperservice: container_name: tvbet_gameshelperservice build: context: “./Build/TvBet.Games.HelperService.Tests” dockerfile: ./Dockerfile args: PROJECT_NAME: “TvBet.Games.HelperService.Tests” ports: – 5891:80 environment: – ASPNETCORE_ENVIRONMENT=Development – ASPNETCORE_URLS=http://+:80 Sending this requests results in 404 when in docker container, but works fine when run locally POST http://localhost:5891/TestGameMessage Dockerfile FROM mcr.microsoft.com/dotnet/aspnet:6.0 as base WORKDIR /app EXPOSE 80 EXPOSE 443 ARG PROJECT_NAME COPY . . ENV ENTRYPOINT=”$PROJECT_NAME.dll” […]
How to run asp.net core 6.0 application in subdirectory?
I’m running a 6.0 asp.net core app in a subdirectory “myapp”. This used to work fine in the asp.net mvc 5 version, but now when I have a form, using Html.BeginForm()
, it posts to the root url instead of under “myapp”.
Why do I have conflict in my database with correct diagram?
This is my diagram:
call instance method that has dependency injections without calling DI Constructor
I have a asp net core web api app that I made using Repository pattern. When a request comes to my controller, I call one of my services dependency methods, then in that Service that was just called, I call another service, which is just my Repository layer. This class in the repository layer MyRepo.cs
relies on a DBContext.cs
class I made.
Injecting configs as a service getting errors options is not null here and an object reference is required for the non static member, field or propert
I am following the example here https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-8.0#bind-hierarchical-configuration-data-using-the-options-pattern, but I keep getting the error _options is not null here
and an object reference is required for the non static member, field or property DBProvider.options
Using TypedResults with Task.FromResult
I have an Asp.Net Core minimal api web app. I want to use the TypedResults in one of my async endpoints. I haven’t written the content of the endpoint so I just created a stub with Task.FromResult. However Visual Studio considers it an error: