I have successfully created a product but the page doesn't redirects to the view I want...and I don't really know why... [HttpPost] public async Task AddProduct
There is a data context: public class OurDbContext : DbContext, IOurDbContext, IDataProtectionKeyContext { public DbSet<Employee> Employees { get; set
I'm working on building a website in ASP.NET Core MVC (the latest version). I have Animals table and Categories table,looking like this: On my AdminController
How can I get the parameters of an ASP.NET Core MVC controller action from the properties of a JSON object that was sent in the HTTP request body? If the reques
When I am passing a single object like below then it is working as per below image [HttpPost] public async Task<ActionResult> Post([FromForm] MyModel Deta
Some of my controller methods have the [ValidateAntiForgeryToken] attribute for the usual reasons. It's only app-internal actions, no cross-site API or similar.
I got the following problem. in my Controller, this method is supposed to return a JSON with the pets from the database. but is being called, the server returns
I'm using .NET 6 to post a form with large form data (about 200Mb), and there is no any file. this's kind of my form in front-end: @using (Html.BeginForm(FormMe
Is there a way to add DbSet<TEntity> Property in DbContext class at runtime without passing through OnModelCreating ?
I was reading a book about Learning ASP.NET Core API when I run to a part saying: We call GetCommandByID on our repository passing in the Id from our route, st
I have an ASP.NET Core 3.1 project. I am using .AddJsonOptions() in startup with and setting IgnoreNullValues to true. I've created a simple test, and it still
I have a problem , jwt authentication return 401 Error. Token was created but always return 401 error. I used layered architecture. I tried many things on start
I'm a beginner and well i'm doing a form which is capable to send information to the database but I needed one more thing to be sent and it is the Id from the u
I have no idea what happened but suddenly the CRUD operations in my simple app no longer work. Clicking on the create button in my partial view, instead of runn
I am experiencing an error when trying to run my ASP.Net Core 3.1 project. The error is at CreateHostBuilder within Program.cs public class Program {
We have hosted a ASP.NET Core v3.1 Website in IIS. But when I try to view the page getting internal server error. This issue only occurs in the specific machine
I'm using a regular html form instead of @html.BeginForm and I have these 2 form tags in my Create.cshtml view file. I was experimenting with routing, but my po
My error: The corresponding CLR type for entity type 'Employee' is not instantiable and there is no derived entity type in the model that corresponds to a conc
I'm trying to connect my ASP.NET Core MVC application to SQL Server. I'm using the Visual Studio for mac. I wrote the connection string like below : "Connect
My question is simple. I have an ASP.net core 3.0 app, I added secrets using visualstudio and pasted my secrets into the secret file normally. Then inside my P