Category "asp.net-core-webapi"

I want scope checkbox checked by default swagger Nswag

Here is Swagger/OpenAPI definition: services.AddOpenApiDocument(document => { document.DocumentProcessors.Add(new SecurityDefinitionAppe

How to use localization with data annotation in a separate DTO Assembly (Asp.net Core Web Api)

I have: a Dto.Library (.Net 5 Library) a SharedResourceLibrary with Resource.resx (.Net 5 Library) How can i use the Resource File Messages in conjunction with

Invalid character in header content ["Host"] Postman

When i try to test api with localhost:[port] it gives the invalid character in header ["Host"] console error. I am using dotnet core webApi. I cross checked the

Why is web.config getting created on publish not on build the project in Asp.Net Core API?

I have Asp.net Core 3.1 API project. When I build it doesn't create any web.config file, but when I publish the API using VS 2019 in a folder, it creates a web.

How to add bearer token authentication to typed HttpClient in Asp.Net Core 6

I'm trying to setup a web api using ASP.Net Core 6 so that users can hit my end points and then I do some work in D365 behind the scenes using a privileged acco

Web Api Return File with additional data

I'm returning a file as follows: public async Task<IActionResult> GetFile(string id) { try { Get

Cannot create database migration on EF Core but It can when you ask to EnsureCreate database

I am trying to inject some repository to a service and some services to a controller but I am using the DbContext is an assembly that is not the startup projec

Cannot create database migration on EF Core but It can when you ask to EnsureCreate database

I am trying to inject some repository to a service and some services to a controller but I am using the DbContext is an assembly that is not the startup projec

ASP.NET Core: [FromQuery] usage and URL format

I am trying to use [FromQuery] in my web api and I am not sure how to use it. Here's the GetAllBooks() method in the controller: [HttpGet] [Route("api/v1/Sh

How to declare global variable in Program cs and use it in controllers in .NET 6.0 Web Api

I have default Program.cs file from Web Api template in .NET 6.0. I am adding variable "test" so I can use its value in controllers. var builder = WebApplicatio

How to declare global variable in Program cs and use it in controllers in .NET 6.0 Web Api

I have default Program.cs file from Web Api template in .NET 6.0. I am adding variable "test" so I can use its value in controllers. var builder = WebApplicatio

Getting Unsupported Media Type for .net core

I'm new in backend development and Gettig 415 Unsupported Media Type in multipart API written in .net core. I have attached the postman image for your reference

How to integrate SOLMAN with my Rest API?

I am working on a project that requires SAP Solution Manager (SOLMAN) to be integrated with Azure Devops Rest API. Functionality: Whenever a Work Package is cre

How to generate oauth_signature in C#

I'm trying to call an API which was associated with OAuth 1.0 version. From the postman wen I tried by passing the header param "Authorization" It's value is as

How could I get a parameter of an action from the ResultExecutingContext when using a Filter

I'm creating a custom result filter that implements IAsyncResultFilter interface. In this filter I need the actual value returned by the Action, but I also need

Hangfire Not Getting Configurations when I try to run Test Case for the method containing hangfire activation .net Core REST Web API

public async Task<IActionResult> SendOrders() { try { RecurringJob.AddOrUpdate("powerfuljob", () => _lab.SendOrders("

implement CRUD functionality with static data using JSON in asp.net core api project

How to do Crud operation on a locally stored json file? For example, I have id, name and roll number. I want to do get, post, put and delete in it using asp.ne

Scaffold-DbContext runs successfully but does not create any models

I am using Visual Studio community edition 2022 and trying to update my Models from database in EntityFrameworkCore 6 (I added new tables and modified some). Wh

Fetching data from an API in ASP.NET Core MVC

I'm facing problem while fetching data from an API in ASP.NET Core MVC controller (imdb api). The problem is I cannot deserialize the current JSON object into t

IFormFile always return null in asp.net core 2.1

Here's how I upload file my Api action : [HttpPost] public async Task<BaseListResponse<MediaStorageModel>> MediaBrand(IFormFile file, int brandId)