Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [asp.net-core]

The tag has no usage guidance.

0
votes
1answer
57 views

Is ASP.NET-Core Hosted-Services supposed to replace Windows Service?

Some time ago when there were no ASP.NET-Core hosted-services the choice for a service-type application was pretty clear, it was a Windows Service. However, recently I've noticed that at least some ...
1
vote
1answer
67 views

Why do some eShopOnContainers Service API Unit Tests not reference API classes only WebMVC? [closed]

I have been trying to learn more about MicroServices architecture and I am using Microsoft's eShopOnContainers as a reference because I am familiar with .NET. I am getting into the part about testing, ...
0
votes
0answers
24 views

Asp.Net Core: creating files in background

I have a web app with SPA client. When user requests a report, that request should create an excel or pdf file in background and notify user via SignalR. I guess I need to save that file somewhere ...
1
vote
1answer
57 views

Pros and Cons of using ASPNET.Core In-Memory Caching instead of Redis? [closed]

I know redis is a very robust caching solution and scales great, but when it comes to simpler non-enterprise websites I feel as if it's a bit too expensive (Azure Standard/C1: $100/m). I'm ...
0
votes
1answer
51 views

Circuit Breaker + Retry - Repository or Application Layer

I currently have a Web App using ASP.NET Core 2.2, Domain Driven Design, Clean Architecture, and CQRS. I'm using MongoDB as persistence. I have developed a Repository pattern to abstract the MongoDB ...
2
votes
2answers
117 views

Queueing async code to execute later

I have a website with basic crud operations that involve data and photos. I also need to extract the metadata for the photos that are being uploaded. My original implementation did not have var puts =...
-2
votes
1answer
114 views

How to implement HTTP PUT correctly

I'm really looking for one good example how to PUT operations should be implemented correctly. What I understood until now: The operation must be idempotent When the resource doesn't exists it will ...
91
votes
15answers
16k views

Should we design our code from the beginning to enable unit testing?

There's a debate going on in our team at the moment as to whether modifying code design to allow unit testing is a code smell, or to what extent it can be done without being a code smell. This has ...
0
votes
0answers
41 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 ...
1
vote
3answers
105 views

Domain Events, CQRS, and dependency resolution in handlers

Currently: ASP.NET Core 2.2. I've been doing quite an extensive research in this topic (Domain Driven Design used together with Clean Architecture): DDD: Where to place domain event handlers? And I'...
0
votes
0answers
26 views

Why do I define my Queries, Data, and Mutation as Singleton when using GraphQL in .NET Core?

Why do I define my Queries, Data, and Mutation as Singleton when using GraphQL in .NET Core? From the doc's dependency injection page: public void ConfigureServices(IServiceCollection services) { ...
2
votes
1answer
245 views

C# .Net Core API design - interfaces vs DTOs

I'm designing a relatively simple web application using .net core. I've mostly done desktop development in my career so far, so I'm a bit new to the nuances between desktop and web development. In ...
-5
votes
1answer
42 views

How should I make my Asp.Net Core web apps available online for beta testing?

Should I run my own webserver? If so, how do I do that? I'm running on Windows 10 with VS2017, IIS Express and MS SQL Server. I don't need a domain name. Just providing access via IP-address is fine. ...
1
vote
1answer
95 views

Correct approach to pass data to service layer

I'm curious what's considered the (best) correct way to pass data to a service layer in ASP.net Core. Say I have a Person entity that has a relation to a Image (profile picture) entity and another ...
1
vote
2answers
132 views

Loose project coupling causes problems in .NET Core solution

we started a new project in which back end consists of several layers (each in different project). For simplifaction I'll define a few: Project.Data -data layer with access to db Project.Repository -...
4
votes
1answer
280 views

Is it safe to add extra role claims to the asp.net identity?

I am using the Azure AD authentication provider for the asp.net web application and I wish to add extra role claims (based on custom application logic, those cannot be provided from Azure AD). ...
-3
votes
1answer
155 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 ...
1
vote
1answer
60 views

How to remove code duplication in Web API versioning

I'm working with ASP.NET core web API project, where I have 8 controllers, multiple DTOs being used for request and response and mappers to map models(also used in the web app) with DTOs. Recently, ...
3
votes
1answer
594 views

Should .NET Core class libraries register their own implementations?

Our team had recently a big struggle of deciding whether it is a good practice or not for the .NET Core class libraries to register their own implementations by the fact of providing a ...
1
vote
1answer
62 views

Can I use Entity Framework with a SOAP API layer over a database?

We have a hierarchical database at our institution that has exposed a SOAP endpoint as the only way to make CRUD operations against it. We are primarily a .NET Core shop. I'm trying to conceptualize ...
1
vote
5answers
267 views

Correct usage of HTTP VERBS in custom REST implementation

I have a server-side service (using ASP.NET Core) that should provide a REST API to various clients. Behind the service, I use a SQL server for data storage. The controller has the following route ...
0
votes
1answer
332 views

Onion architecture applied to an .NET application

I am trying to figure out how to translate the onion architecture into an ASP.NET Core WebAPI solution, this is what I ended up with: Let's say I have an application that takes a file path / uri into ...
0
votes
0answers
36 views

Choice between PUT and a separate request for each change for CRUD-based UI

I'm making an HTTP API for ASP.NET Core Identity. Basically what I want is a remote version of this: https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.usermanager-1?view=...
0
votes
1answer
47 views

What's the best approach to write chronology entries on certain actions in ASP.NET Core MVC?

I'm working on a software product that entails users opening up a case and taking actions to process the case, changing the status, creating tasks, etc. I'd like to provide a history of the actions ...
-1
votes
1answer
61 views

Writing a blog post website with markdown

so I'm working on a website project with the goal of writing my own blog posts with markdown syntax. I made some thoughts regarding the handling of the markdown and the conversion to HTML, storage ...
-1
votes
1answer
559 views

Creating a mobile app based on the ASP.NET Core website

Coming from Desktop development, I'm in the middle of my very first web project (as a small side/learning-project). I'm using ASP.NET Core 2. I'm already thinking about going mobile too. What are my ...
1
vote
3answers
343 views

Should it be a claim, a role or a policy?

The distinction between roles and claims is that roles describe a set of users and claims describe a property of a user. So there can be a role "Administrator", but there can also be a claim "...
0
votes
2answers
485 views

Unit Test a CRUD Controller MVC

I have looked through answers related to this but they don't seem to solve my problem. I am fairly new unit testing and testing as a whole. I just finished a small web application using ASP.NET Core ...
27
votes
5answers
9k views

Should I check if something exists in the db and fail fast or wait for db exception

Having two classes: public class Parent { public int Id { get; set; } public int ChildId { get; set; } } public class Child { ... } When assigning ChildId to Parent should I check first if ...
4
votes
3answers
808 views

Mapping API models(DTOs) to rich domain models

How to implement HTTP's PUT that works with child collections when using DDD's rich domain models? Let's say we've got an aggregate root with a nicely encapsulated collection of items: (I omitted ...
0
votes
1answer
177 views

Dealing with child collections updates in Web API

Let's take some classic enterprise example: Order and OrderItem public class Order { public Guid Id { get; set; } public ICollection<OrderItem> Items { get; set; } } public class ...
1
vote
0answers
41 views

Correct method for handling edit/update scenario in repository pattern

I have a repository pattern employed in my .NET Core 2.1 project. While implementing the edit/update scenario, I have a doubt. My domain: public class Component { public int Id { get; set; } ...
1
vote
1answer
294 views

Entity Framework - extending OR injecting services into DB Context

I fear I'm asking a somewhat silly question, but I'm now completely lost as to which principle I should follow. To my understanding - in terms of Single Responsibility Principle it's best we don't ...
-2
votes
1answer
98 views

How to migrate an existing ASP.NET MVC site to ASP.NET MVC Core - specifically on authorization

I am in the process of upgrading an existing website to ASP.NET Core 2.1. The goal is simplification and ease of maintenance. Existing site is using: EF and .NET 4.6.2 A [Users] table in SQL Server ...
-1
votes
1answer
342 views

What is an example giving the difference between Domain Model and Data Model?

I've seen many articles describing differences between Domain Model and Data Model. However none of the articles have picture representations showing difference. https://stackoverflow.com/questions/...
2
votes
1answer
947 views

What is the difference between a Query Object and a Repository?

What is the difference between Query Object and Repository? Martin Fowler 'Patterns of Enterprise Architecture': “an object that represents a database query.”, Also should a QueryObject always be ...
0
votes
1answer
91 views

Example case of when using ASP.Net w/Angular vs just HTML and Angular would allow provide capabilities the other cant

So I'm trying to justify my case of using ASP.Net Core with Angular in a new application, where the .NET application does little more that provide the basis for the Angular app. It's really similar ...
2
votes
2answers
573 views

C# Namespace Ordering Coding Convention

Is there a general coding convention in ordering namespaces? Is it always order of importance, or alphabetical? Currently I order by main important ones first. I know it does not affect program, just ...
2
votes
1answer
65 views

Abstraction for Account transactions and balance

We have 10 applications which updates account balance table, without logging credit/debit line transactions (not sure why). They all have the pretty much same SQL Statement. In order to get out of ...
-1
votes
1answer
53 views

C# Separate Online Store into Different Solutions and Nugets

I am creating an Online Shopping Cart store. It is built through Net MVC Core. There is a Front End View website: html, css, razor. Then we have backend code design for Customers: including shopping ...
0
votes
2answers
66 views

RESTful API authorization for updatable fields

I've got a resource as follows where state is a enum: { id: 123, industry: { id: 245, name: "Farming" }, "scheduleDate": "2018-01-01", "state": "Requested|Approved|Standardized|...
1
vote
2answers
928 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 ...
2
votes
0answers
257 views

Design a Windows Service with self-hosted ASP.NET Core Web Services and UPD port listeners

I'm designing a software platform in automation that is responsible of many different tasks like: Core functions Driver interface for machines UDP listener for machine messages from PLC UDP listener ...
2
votes
1answer
238 views

Best practices for translatable models in Entity Framework Core 2.1+

I'm building an Entity Framework Core-backed ASP.NET Core RESTful service and I have entities / models such as Product, Document etc with description in multiple languages. I want to be able to ...
2
votes
4answers
260 views

Can I assume nobody deletes user generated content off my server's file system?

Situation Currently I'm developing a web service in which users can (generally) upload binary files. These files are stored in the file system of the host OS and some additional metadata about the ...
1
vote
0answers
517 views

Where should I put my enums and interfaces?

I have an asp core MVC project for a college and I would like to implement a timetabling feature. To see if I could successfully even generate a dynamic HTML timetable, I started playing around in a ...
0
votes
0answers
61 views

Should I use CQRS in this case?

I'm building web API. I have a problem where input differs from the output, for example, input expects just the id and output returns entire object. Also, there are few things specific to the output ...
0
votes
1answer
99 views

MVC Core Data Access Naming Convention Folder vs Repository

We have Customer transaction table with many foreign key relationships. We only want to see certain columns of the 3 tables joined in a web interface. Eg just Date, PurchaseAmount, ProductName, ...
2
votes
1answer
994 views

Is .NET ASP MVC core suitable for rapid web development?

I currently work for a company who builds web applications for businesses and entrepreneurs, typically 4-6 projects per year. We currently use Laravel/PHP which allows us to build apps relatively ...
4
votes
1answer
1k views

MVC Core Repository Pattern for Multiple Lookup tables

We have Customer transactional table with multiple lookup tables with foreign keys. We want to create dropdown menus using these lookup tables, when CustomerService creates a Customer order ...