Questions tagged [asp.net-mvc-web-api]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-2 votes
1 answer
93 views

How often should I request a token when communicating with a third-party API?

I have an ASP.net web API. I would like to call another API that has an authentication token inside my API. The code flow is as follows: My API is called → Get authentication token from 3rd party API →...
user avatar
-1 votes
1 answer
145 views

Can I call a WCF endpoint from ASP.Net Web API?

I have a web api with controller methods that use rest http(post/get calls). Clients consume this API with normal httpclient calls and I pass an http response back. My use case is I have a legacy ...
user avatar
1 vote
0 answers
299 views

SignalR Handle Multiple Clients in my Scenario

I currently have multiple clients who need to be informed when a customer creates a new order. Each customer is registered to an individual client and customers create orders on my website (each order ...
user avatar
  • 11
1 vote
4 answers
647 views

Should you validate route parameters or let them fail with a 404?

So this is an example endpoint to fetch one user by its username [HttpGet("{username}")] public async Task<ActionResult<object>> GetUser([FromRoute] string username) { // ... ...
user avatar
2 votes
1 answer
902 views

How to authorize and store user login from a xamarin frontend to a asp.net core api

So I suppose this question isn't as much as a 'How to' but a 'which way' kind of question. So I have a .net core api backend that makes calls to a dB I also have a xamarin forms project that ...
user avatar
  • 147
7 votes
2 answers
635 views

Separation of concerns and other best practices across Controllers, Services, Providers and Stores in ASP.NET when building a REST web api

I am traditionally a desktop app developer, but circumstance has thrust me into the role of doing web client and corresponding REST api logic for a project I am involved in. Unfortunately, I'm a one-...
user avatar
  • 171
-3 votes
1 answer
237 views

What is the simplest version of best practice application architecture for a backend in C# and ASP.NET Core WebAPI?

I know that in some contexts, best practice would be DDD, CQRS and EventSourcing, but in my case this would be too complicated of two reasons: My team is beginners, and we want them to be productive ...
user avatar
-3 votes
1 answer
155 views

A True RESTful API | Help needed

I know that a RESTful would have unified API and it treats everything as a resource (a noun, example a book, a product,...) and it can be applied with CRUD operations using HTTP Verbs (GET, PUT, POST, ...
user avatar
1 vote
2 answers
2k views

Should an ASP.NET Web API application use Entity Framework in the API controllers?

Im a bit confused about what is best practice when working with Entity Framework and ASP.NET Web API. I am working on a project that contains a iOS/Android app and an API the app will use to ...
user avatar
-1 votes
2 answers
1k views

Why should I use REST API?

I somehow get the point of REST API, like for example you want to get the list of customers to the database server, you have to request a GET method and the server will throw a response with a ...
user avatar
0 votes
0 answers
661 views

Separating models in a Backend-For-Frontend (BFF) API

At the moment I have a frontend client calling several backend REST APIs. For example a call may be to get information about a certain vehicle. Then the client will call REST API A to get some ...
user avatar
  • 623
0 votes
0 answers
140 views

Authenticated ASP.NET Core MVC site consuming web API

I have an ASP.NET Core 2.2 MVC site, that uses Facebook as an identity provider. Users can click the login button, they are redirected to Facebook to enter their credentials, and are then redirected ...
user avatar
  • 333
0 votes
0 answers
384 views

Running multiple MVC projects: One site

I am developing a "platform", I have an MVC site that will hold all the main data, as well as our generic API, uses Microsoft authentication to create an account, then our employee MVC will add the ...
user avatar
0 votes
1 answer
195 views

How to manage model(s) between web client (DMZ) and web API?

I have this web API project which handle all database access via entity framework. I have another web client reside in DMZ to call those APIs (via ajax or c#) in the web API project. When I make API ...
user avatar
  • 219
-4 votes
1 answer
338 views

When designing a web application with Vue.js and ASP.NET Core, is ASP.NET solely for the API?

When creating a web application from scratch with ASP.NET MVC Core (using Visual Studio 2017) and using Vue.js, is the MVC Core part of the application solely for the API? What other function would ...
user avatar
  • 3,629
7 votes
2 answers
12k views

Should integration tests use database? [closed]

I know that integration tests test parts of project that interaction with each other somehow. And I need to test this interaction. And there is the question: 1)Should these tests use real database ...
user avatar
2 votes
1 answer
2k views

Calling executables from an ASP.NET WebAPI

I have an Angular application with a table, and I'm considering having the console application take the name of C# programs that the user can run. I was thinking of passing the name or code of the ...
user avatar
  • 131
2 votes
1 answer
715 views

Onion Architecture, Project Architecting and Authentication

I am learning ASP.NET MVC & Web API and trying to implement Onion Architecture with Repository Pattern for one of my Test projects as part of my learning. I have developed single MVC Projects ...
user avatar
1 vote
2 answers
895 views

Putting it all together - DDD, CQRS, Web API

I need some expert guidance. I'm trying to learn the concepts as well as implement them, and it's possible I might be over-engineering some. But that's OK, because I am wanting to learn and gain ...
user avatar
3 votes
2 answers
3k views

Stateful authentication in REST API using tokens

I have recently started on a project involving a REST API. The API requires authentication with requirements for administrators to be able to view logged in users and to be able to revoke specific ...
user avatar
-1 votes
2 answers
61 views

What should be the REST API (URL) for a user to be assigned to multiple territories

In our application we have a user who can be assigned multiple territories. What is the best way to expose the REST API? Should it be as : [POST] www.xyz.com/Territory/User OR [POST] www.xyz.com/...
user avatar
2 votes
2 answers
3k views

ASP.NET Web API and MVC Architecture for Web Application

We have a single solution Visual Studio web application with multiple projects. One of the projects (Services project) has APIs for our App clients (Android/iOS). There's separate project for MVC ...
user avatar
  • 341
0 votes
2 answers
353 views

Wait time created by having separated REST API and web application

I created a new Asp.Net MVC web project. I took the decision to create two different apps, the first one would be a web REST API that would provide all data for the second one, which would essentially ...
user avatar
0 votes
1 answer
1k views

Pattern for web service response caching, but only use the cache for when the data store goes down or request otherwise would fail

We have a REST web service written in C# in ASP.NET MVC/WebAPI. When the underlying data store fails, this can lead to our service being completely unavailable, instantly. There is currently no ...
user avatar
  • 109
3 votes
2 answers
7k views

Web API - strong classes or dynamic?

My web api method should return some structured data about my profile. To do it I created the following POCO classes: public class ProfileInfo { public string FirstName { get; set; } public ...
user avatar
0 votes
2 answers
2k views

Integrate Web API Services with multiple authentication services

In a multi-tenant deployment of Web application, How can the Asp.Net Core Web API services be designed to work with different authorization services? The Web applications use OAuth and JWT Bearer ...
user avatar
  • 153
1 vote
1 answer
326 views

Creating JWT token internally

I need to implement JWT tokens in my ASP.NET Core API app to handle authorization. My question is, what is the risk of generating my own JWT token within my API app as opposed to having it handled ...
user avatar
  • 293
1 vote
2 answers
645 views

Connect to different database based on URL

I am developing a SAAS application where : A single web application is hosted in IIS which will serve to multiple companies and each company will have its own database. The web application and ...
user avatar
2 votes
1 answer
284 views

What features are missing from WCF Rest Implementation

In this question about using WCF and/or WebAPI, there is this quote: I was asking myself the same question until I found this WCF and ASP.NET Web API comparison page on MSDN (with my own emphasis ...
user avatar
  • 832
-1 votes
1 answer
615 views

Should I use the same solution for WebAPI and autogenerated client for it?

I have the following situation: ASP.NET Core WebAPI solution which uses Swagger Automatically generated client for WebAPI using Autorest, extended with custom authorization. This client also will be ...
user avatar
2 votes
4 answers
5k views

Web API - How to prevent the POST-ing of entities with custom Id values

Let's say I have the following model: public class Product { public string Id { get; set; } public string Name { get; set; } public string Category { get; set; } public ...
user avatar
  • 163
2 votes
2 answers
4k views

Asp.net mvc web api model validation best practice

I have an annoying code smell in my asp.net core api that I am passing around, and I can't come up with a way to fix. In an MVC controller action, usually there is a very straight forward logic, at ...
user avatar
  • 271
0 votes
1 answer
484 views

Use of iFrame to avoid IE oddities

I'm working with a team on an ASP.NET MVC C# EF application that needs extensive Help materials. The Help materials will be stored on a helpdesk site (FreshDesk) so they can be accessed as a ...
user avatar
  • 195
0 votes
2 answers
1k views

Asp.Net Mvc 5 / Web Api 2 unit testing data access layer

Let's say I have IRepository interface implemented by Repository class(uses database context to implement IRepository methods). And IUnitOfWork interface implemented by UnitOfWork class using ...
user avatar
7 votes
3 answers
33k views

Is it okay to have multiple get action methods in ASP .Net Web API controller according to RESTful API constraints?

I have the following interface in my business layer public interface IUserService { void CreateUser(User user); List<User> FindUsersByName(string searchedString); ...
user avatar
1 vote
1 answer
1k views

Dotnet (.NET) core MVC WEB API SPA Project and Solution Structure

I am building a new simple web application using dotnet core (.NET Core) and Angular SPA. Does it make sense to split API and Web App into different projects? This would complicate things (...
user avatar
  • 121
0 votes
1 answer
252 views

Architecture for email service API

I would like to build an application for sending emails. So I chose ASP.NET Core (API) which will be deployed by Docker. The application will get some request and "do some things" and then sends ...
user avatar
0 votes
2 answers
4k views

Entity framework vs pure ado .net in calling stored procedure in an enterprise project

There is an enterprise project, which all the business implemented in databases and in the stored procedures, and web API is just like a light wrapper which get the request and deliver it to proper ...
user avatar
2 votes
2 answers
838 views

Best technique for pushing many records and files to a system: WEB API or FTP

I have a website where users can upload manuals (PDF documents) for their products. Basically, they first add the product to the system and then add 1 or more manuals to that product. A manual can ...
user avatar
  • 33
3 votes
2 answers
199 views

If I have ten objects, should there be ten controllers for a Web API?

Is it good design to have a controller for each object of your API? I know this is a short question, but it's really a fundamental question that I do not know. Say I have a school or a CRM. That is ...
user avatar
  • 3,629
20 votes
2 answers
10k views

Isn't CQRS overengineering?

I still remember good old days of repositories. But repositories used to grow ugly with time. Then CQRS got mainstream. They were nice, they were a breath of fresh air. But recently I've been asking ...
user avatar
  • 4,663
1 vote
1 answer
2k views

What is a good technique for supporting sorting and filtering with a REST WebAPI

I'm in the process of developing an ASP.NET Core WebAPI that uses EntityFramework to access the datastore. One of the things we need to support is sorting and filtering. I'm assuming that the HTTP ...
user avatar
2 votes
1 answer
5k views

ASP.NET Web API: enum or strings

I have an ASP.NET Web API application. It uses enums for some fixed sets of states or types. Now I need to extend enum to support more values. But it will break backwards compatibility so I need to ...
user avatar
4 votes
1 answer
317 views

Joining table with table from external database/API

For a prototype project I've created an Angular 2 application with simple CRUD functionality using Auth0 to handle authentication with a back-end containing a Web API (core), Service and Repository ...
user avatar
  • 161
1 vote
1 answer
103 views

In which order should page- and pageSize-parameters be used?

I'm building an api and a bit into the development I realized that I constantly change the order of the page and pageSize parameters. Currently I use C# and javascript, so the method declaration ...
user avatar
  • 443
3 votes
1 answer
627 views

Which is more secure for the DB, Web API or MVC with repository pattern & EF?

I am 1 of 3 developers. The other 2 use Web API and angular to build web apps. I prefer ASP MVC with a repository and EF. The stated argument is that a service is more secure when accessing the ...
user avatar
  • 183
1 vote
1 answer
510 views

Consume ASP.Net REST API service

I am creating ASP.Net REST API application and stuck on the part where I should consume the REST service. I am not sure how to find the way let me accomplish the following: 1. I don't want it to be ...
user avatar
  • 113
0 votes
1 answer
195 views

How To Design Tiers For Web and Mobile App

The scenario is to have a Mobile App and Web App too. So currently I can think of two scenarios Which one do you guys think is better? PS : If needed I can also implement DAL Layer in both the ...
user avatar
3 votes
1 answer
2k views

Web API to Windows Service communication via ZeroMQ

I have an ASP.NET Web API 2 web service. This is the interface customers will use to submit data. I have a Windows Service running on an internal server. I will be sending the customer's POST data to ...
user avatar
7 votes
1 answer
3k views

One Large API to several microservices vs lots of small APIs each with their own API

I have an application that is beiong split out into a number of services. From a previous question on here, I think that initially JSON/REST is the way to go for communication. Some of my micro ...
user avatar
  • 243