Skip to main content
23 votes
Accepted

Isn't CQRS overengineering?

Is CQRS a relatively complicated and costly pattern ? Yes. Is it over-engineering ? Absolutely not. In the original article where Martin Fowler talks about CQRS you can see a lot of warnings about not ...
Machado's user avatar
  • 4,120
9 votes
Accepted

Should integration tests use database?

1) Should these tests use real database data? I mean I'll have to connect to a real database? If you're testing the integration between your software and the database, then yes you should use the ...
amon's user avatar
  • 135k
8 votes
Accepted

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

I know you cannot have multiple gets according to REST Not really. REST and API modelling are different subjects. REST APIs are meant to be an integration strategy, based on the premises introduced ...
Laiv's user avatar
  • 14.7k
6 votes

Isn't CQRS overengineering?

CQRS is not a one-for-one replacement for Repositories, exactly because it's a complex, costly pattern which is only useful in some cases. Here's what Udi Dahan has to say in merit: Most people using ...
Sklivvz's user avatar
  • 5,250
5 votes

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

Web API and MVC a for all practical purposes the same. A Web API interface is a subclass of an MVC Controller. The only difference is instead of returning a rendered template from a Web API controller,...
Michael Brown's user avatar
5 votes
Accepted

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

Really this is about exposing your microservices individually as opposed to behind a wrapper. I would say that if your services are already 3rd party ready" then simply exposing them would make sense. ...
gbjbaanb's user avatar
  • 48.6k
5 votes
Accepted

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

Define 'object' You have one controller for each resource. Where a resource is a thing that your API provides (user, customer, student, sports-team, etc.) Resources don't necessarily map one-to-one ...
JamesT's user avatar
  • 438
5 votes

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

Firstly, there is no such thing as a "best practice" architecture. There is only that architecture that best fits the specific need at hand. We're doing a great disservice to software developers ...
Robert Harvey's user avatar
5 votes
Accepted

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

If you want to return a meaningful error message you'll probably want to add validation. Every application I've worked on has done some request validation and returned an error message before ...
BenCr's user avatar
  • 186
4 votes

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

REST does not limit the number of methods. You can use as many of them as you need. The API and your implementation are 2 different things. If you want your API to follow the REST architecture then it ...
Kwebble's user avatar
  • 345
4 votes
Accepted

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

Actually... back in the day (and still today) it was very common to not give people the ability to generate ids on the client side for one simple reason: the ids were auto incremented integer values ...
Andy's user avatar
  • 10.4k
4 votes

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

as far as I know you cannot have multiple gets according to REST No, not really. What you can't have is state. For instance, if you have an API such as: POST /set-current-user/[id] GET /user-info ...
Arseni Mourzenko's user avatar
4 votes

Web API - strong classes or dynamic?

The advantage of having a strongly-typed return value is that you can have a descriptive document (for example swagger using Swashbuckle) that allows people to auto-generate a client for your API. ...
nvoigt's user avatar
  • 8,202
3 votes
Accepted

Joining table with table from external database/API

I would exclude option 3. mostly because it seems easier to maintain the concept of a single API to the client application; the fact that your Web API endpoint for users further calls into the Auth0 ...
João Angelo's user avatar
3 votes
Accepted

Onion Architecture, Project Architecting and Authentication

1) Am I going in the right direction? This is a much too broad question if you want it answered with any amount of detail. We don't know exactly what your current experience is and whether there are ...
Flater's user avatar
  • 52.8k
3 votes
Accepted

Calling executables from an ASP.NET WebAPI

Its not a great idea to have a web api call an executable. There are a number of issues you have to consider. 1: Security We are basically exposing the command line to the web. Any flaw in the way ...
Ewan's user avatar
  • 77.5k
3 votes

Why should I use REST API?

I know it might be a dumb question or this is the right question to ask. aren't we always doing such kinds of things with simple web without REST API? The client-side (browser) will make a request, ...
VoiceOfUnreason's user avatar
3 votes

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

First, is this view of the separation of my classes really how others structure their code? Yes, unfortunately. Second, is it legitimate for one Service to instance and leverage a second Service? ...
Robert Bräutigam's user avatar
2 votes
Accepted

Consume ASP.Net REST API service

WCF uses SOAP, which has a lot of overhead to use. In this case, you would probably need to auto generate clients for particular platforms, because it would be too much work by hand. There are a lot ...
Kasey Speakman's user avatar
2 votes

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

This blog post illustrates suitable REST-compliant query strings, in particular: ?sort=created,modified and ?page=2&page_entries=10 To create custom queries, you can either build up a custom ...
Robert Harvey's user avatar
2 votes

ASP.NET Web API: enum or strings

Its best to use enums serialised as strings and use versioning to deal with backwards compatibility issues. This gives you the type safety of enums in your c# code, but retains the meaningful values ...
Ewan's user avatar
  • 77.5k
2 votes

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

I'd say usually YES because if you have less, you will give more than one responsability to the same controller, which is not good. I see one case where you could not need one controller : It's when ...
Walfrat's user avatar
  • 3,516
2 votes

What features are missing from WCF Rest Implementation

WCF can be pretty complicated if you let it but is pretty easy if you need basic SOAP and that holds true even if you need a few frills and more exotic transport, authentication or protocol options. ...
LoztInSpace's user avatar
  • 1,199
2 votes

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

Have you looked into existing so-called "Content Management Systems" (CMS)? In case you want to roll your own system, though, a REST endpoint with a single page web app as the frontend with a user ...
yeoman's user avatar
  • 383
2 votes

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

Couple points here: You should own your own, internal, unique identifier, which should not be exposed via the API, neither for adding or viewing. The identifier is for your database to create key ...
John Wu's user avatar
  • 26.6k
2 votes

ASP.NET Web API and MVC Architecture for Web Application

It looks like you are missing a service layer between you business logic and your websites. If you draw in a horizontal slice on your diagram for it you can see immediately that you have a choice of ...
Ewan's user avatar
  • 77.5k
2 votes
Accepted

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

I guess you are trying to build Web Application using .Net Core and Vue.js and you do not want to use MVC Razor view. IF that is the case, .Net Core is the back-end (Server side) framework where you ...
Ishwor Khanal's user avatar
2 votes

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

Yes you should split them. Why? Security and Privacy Backwards Compatibility Security and Privacy Imagine that you have a User and that user has a password: do you wish to return that password ...
Kain0_0's user avatar
  • 16.3k
2 votes
Accepted

A True RESTful API | Help needed

Your RESTful API does not necessarily need to present a CRUD interface. Resources that are computed from other data do not need to support Create, Update or Delete operations, but they can still be ...
Hans-Martin Mosner's user avatar
2 votes

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

If you are considering to add such a route level validation then you should be aware of the following: If the constraint is not met then your action won't be called. Other action might be called ...
Peter Csala's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible