Questions tagged [asp.net-core-webapi]

Questions about ASP.NET Core web APIs and web apps that are not dependent on MVC Views or Razor Pages.

Filter by
Sorted by
Tagged with
2 votes
1 answer
115 views

Action argument supporting multiple units as string

I've got a controller with two actions that need to support two units: hours & times. The url should read like this: ...
t3chb0t's user avatar
  • 44.3k
1 vote
1 answer
134 views

Azure DevOps Git: Fork into another Repo using Azure DevOps REST API

In my Azure DevOps Project, I have a Git repository that I would like to copy to another Azure DevOps Project. In other words, I should be able to copy the original repo into other Azure DevOps ...
Mugil Karthikeyan's user avatar
3 votes
1 answer
256 views

Export and import work items from Azure DevOps

I'm working on an application that exports and imports work items from Azure DevOps. To import work items into Azure DevOps, I have written the following code. Would you be able to review and make ...
Mugil Karthikeyan's user avatar
2 votes
1 answer
2k views

.Net Core 6.0 : Entity Framework - Either Or / Neither Nor / Both in Where clause

I am building a .Net Core 6.0 application that uses Entity Framework. I have situation where I need to apply the filter(Where clause) based on two properties (eg: Guid? skillType, string skillName). ...
Mugil Karthikeyan's user avatar
0 votes
1 answer
4k views

Web Api to upload excel file

I work on asp.net core 2.2 web API using C# language I need to rewrite function below with best syntax and with best practice web API below get Excel file from upload and return Excel file it working ...
ahmed barbary's user avatar
1 vote
1 answer
282 views

Best practices in regards to pass and deserialize data, when calling an API endpoint from a MVC-project?

In my application, I only show users their own data. For that, I need to know in the backend, which user is requesting data. I use the username for that and therefore, I need to send the username as ...
thesystem's user avatar
  • 113
4 votes
2 answers
695 views

pagination in entity framework and refactoring

I have an api end point which returns the paginated result, the corresponding code for that is as below: ...
testcr's user avatar
  • 41
-1 votes
1 answer
502 views

ASP.Net Core API JsonPatchDocument

Hi I am creating a website for my chiropractor and I am creating the API for data access. I am creating a HttpPatch Method and want to know if this is the right approach so would be grateful if you ...
Simon Price's user avatar
5 votes
2 answers
629 views

ASP.NET Core Web API + Pure DI

I was playing around with ASP.NET Core 3.1 and tried to implement Dependency Injection flavor called Pure DI, i.e. without dependency container (even the built in one) to instantiate Controllers. You ...
Piotr's user avatar
  • 151
3 votes
1 answer
202 views

ASP .NET Core DI: Dependency on single implementation of multiple registrations of service type

Problem I have a DI scenario where I have multiple classes that implement a common interface (IModelService). I'm using a generic framework class (...
Neo's user avatar
  • 139
2 votes
1 answer
62 views

Delete redundant files in folder and db

I want to delete files from folder, which are not stored in DB, and DB records, which no more linked to files. My code: ...
Mykhailo Mushynskyi's user avatar
1 vote
1 answer
195 views

Optimizing calls for reauthentication by caching tokens and cookies

I am currently developing a REST service in ASP.NET Core 2.2 that acts as a wrapper upon a REST API provided by a reporting solution. The reporting systems REST API authenticates the user based on a ...
Alexei's user avatar
  • 1,824
1 vote
1 answer
78 views

A ValueService is used to share data among objects

I have C# code that makes some calculations for physical models. I have this project class: ...
rst's user avatar
  • 207
0 votes
1 answer
2k views

Upsert with .Net Core Web API

I am using .NET Core 2.2, EF Core and C#. I have created a web API project. I was requested to do an Upsert (insert or update). The entities structure is: Movie User Rating: this is used to give a ...
MarcosF8's user avatar
  • 101
4 votes
2 answers
400 views

Streaming modified lines of a file from a Controller

I am writing a piece of software that aims at streaming the modified lines of an external file located at given uri (and retrieved as a QueryString parameter). I am trying to minimize the impact of ...
Natalie Perret's user avatar
0 votes
1 answer
3k views

Asynchronously fetching data from the database

The following C# code is written to fetch the Categories data from SQL Server Database using Asynchronous Task for HttpGet. The Dapper library is used as ORM. I ...
Coder Absolute's user avatar