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 ...
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 ...
8
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 ...
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 ...
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.
...
5
votes
Accepted
Migrating large silverlight business application to MVC
Your basic problem is that the client technologies are fundamentally different - one of the key drivers for the evolution of Silverlight was to put "rich" client capabilities into the browser.
What ...
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,...
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 ...
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 ...
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 ...
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
...
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 ...
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 ...
4
votes
Should we call Web API from MVC application in same solution?
I would say; prefer MVC calling WebAPI through HTTPClient. It is overwhelming go around "core dll" logic but main advantage is that your overall system will have a single point access to domain ...
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.
...
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 ...
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 ...
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 ...
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, ...
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?
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
asp.net-mvc-web-api × 91c# × 33
web-api × 26
asp.net × 18
rest × 16
asp.net-mvc × 15
.net × 10
api-design × 10
asp.net-mvc-4 × 8
authentication × 7
asp.net-core × 7
architecture × 6
entity-framework × 6
web-applications × 4
web-development × 3
domain-driven-design × 3
api × 3
security × 3
web-services × 3
sql-server × 3
caching × 3
wcf × 3
oauth × 3
mvc × 2
dependency-injection × 2