All Questions
Tagged with asp.net-mvc-web-api c#
32 questions
0
votes
2
answers
748
views
Best practice ASP.NET MVC share code with Web API
I'm trying to develop an ASP.NET MVC-application with an additional Web API.
To reduce code-duplication, I'd like to share as much code as possible, but with the possibility to differentiate between ...
-2
votes
1
answer
411
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 →...
1
vote
4
answers
3k
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)
{
// ...
...
4
votes
1
answer
1k
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 ...
-3
votes
1
answer
359
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 ...
-3
votes
1
answer
174
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, ...
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 ...
0
votes
0
answers
724
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 ...
12
votes
2
answers
19k
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 ...
2
votes
1
answer
3k
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 ...
2
votes
2
answers
4k
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 ...
0
votes
2
answers
611
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 ...
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 ...
3
votes
2
answers
9k
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 ...
2
votes
4
answers
7k
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 ...