Questions tagged [asp.net-core]

A free, open source and cross platform web development framework for building .NET web applications.

Filter by
Sorted by
Tagged with
3
votes
1answer
53 views

ASP.NET MVC Caching of ViewModels

My question is regarding caching and ViewModels in ASP.NET (Core) MVC. I have a service which injects a Repository<T> which is used to fetch domain models from the database. The service layer ...
-2
votes
0answers
14 views

ASP Net Core Web API for WPF & Xamarin clients?

I've been researching this for so long and I'm still very confused due to the gigantic amount of different yet similar concepts, terms, frameworks and frankly the overwhelming ocean of information, so ...
1
vote
0answers
30 views

How to implement timing-mechanism for fantasy draft process utilizing ASP.NET Core 3.1 SignalR

I have developed a Fantasy Draft system utilizing ASP.NET Core SignalR, along with Azure's SignalR service (for backplane/scaling stuff). Last year I utilized a poor-mans' javascript version that just ...
0
votes
1answer
57 views

Should I decouple domain models from IIdentity in ASP.NET core?

I saw a lot of examples of decoupling domain models from Identity models. For my knowledge, currently IIdentity is included in standard .NET library, so is this actual now and should I follow this ...
0
votes
4answers
177 views

What problems could be caused by inserting into a database on an HTTP GET?

I have code that checks if the scanned qr code exist in the database and if it exist it will insert data into another table but I did it in the HTTP GET request, is this alright to do it this way or ...
0
votes
0answers
21 views

How to create controller and service dynamically during runtime (inspired by directus)?

Use Cases I would like to have a c# system that can Create a table in the database during runtime On a webpage a user can create a object (for example TodoItem) and add fields for this object (...
5
votes
4answers
241 views

How to create a modular system of multiple .NET Core applications extending a single application?

So first of all let me explain what I want to achieve: I want to create a basic .NET Core console application which is responsible for loading external extensions (more on this later on), listening ...
0
votes
0answers
28 views

TransactionScope in DAO or in BLL (Business Logic Layer)?

I've been working with Entity Framework, Repositories, Unit of Work, DDD, CQRS... But I have an different challenge now...my company is working in the below architecture: Contrllers -> BLL (...
0
votes
1answer
54 views

Do I need a service layer if my current service layer looks like this? Also asking about other basic controller service-repository patterns questions

I currently have a service class RoutineService.cs that contains methods that each perform one thing, call the repository and return that exact same object. With how simple it is, is my service ...
-1
votes
3answers
132 views

Preventing presentation layer from directly accessing repositories?

I'm trying to design my application in line with the "onion architecture" principles, and have something like the following: HospitalController (depends on IHospitalService) \ --- ...
0
votes
1answer
64 views

Best practice for pulling bulk data from APIs and storing in database

I have written a small application using ASP.NET Core to create and manage collections of cards for a collectable card game. I currently have a version that successfully downloads bulk card data via ...
0
votes
1answer
86 views

Implementing the microservice pattern

We are developing a system that runs a certain kind of simulation for our customers: Every simulation runs on it's own server. We typically have a two digit number of simulations running. A client ...
0
votes
1answer
84 views

Right way of folder structure in MVC Project

I'm building a project with C# AspNet.Mvc. I'm using Entity Framework Core. It has Poco which maps in data from DB. On Mvc project itself i've got ViewModels folder where i have models topass between ...
0
votes
0answers
41 views

Where to carry JWT Tokens in Requests

I have an AspNet application which I'm authenticating using a separate AspNet Core application. It returns a JWT token which is then carried in a Http Cookie. The AspNet application validates each ...
1
vote
0answers
51 views

How do you design a micro-app Blazor project?

I have been tasked with creating a unified UI for my current company for our Blazor Apps. We have 15 or so apps and we need to add more. Our current requirements are: UI appears the same The Menu ...
-4
votes
1answer
52 views

Changing databases in general repository methods when using Dapper [closed]

I'm developing a multi-database application. There is one admin database and many customer databases which are identical in structure. I also have a generic RepositoryBase which looks like the ...
0
votes
1answer
40 views

Strategy to make sure relevant cache records are expired on data update

In our database, we have around 150 different tables. However, there are a handful of them that are key, as in they get referenced pretty much everywhere. We also have quite a few reports that we pull ...
0
votes
0answers
67 views

What 'onion' layer should ASP.NET Core WebApi controllers reside in?

I have controllers and they are in my API layer. They don't use types from the Infrastructure layer and (in Cockburns description of Onion Architecture) do act as the entry point to the domain. I've ...
2
votes
1answer
188 views

Is ASP.NET core over implementing CORS specification or is my understand of the CORS specification imcomplete?

Overview: I have performed 2 experiments to understand the implementation of asp.net core libraries with regard to the CORS specification The experiment 1 shows an web page (html) is not able to make ...
2
votes
3answers
173 views

Is this approach with JWT tokens wrong?

I have .NET Core WebApi application with JWT token for authorization. I also have roles and permissions. To make it more flexible for end user, I decided to make permissions like this: [Authorize(...
0
votes
1answer
50 views

Designing asp.net core web api to add sub classes/specialized objects

I have not worked with EF for a while. As an exercise, I am writing a core web api that allows keeping track of a user medias. A media can be a postcard, a photo album, a recording, a book... I would ...
-3
votes
2answers
86 views

Dependency access control in DI

As I'm just getting into ASP.NET Core, I'm also continuing to slowly learn about Dependency Injection and still trying to identify some value in it for our practical purposes. The point I've reached ...
1
vote
4answers
134 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) { // ... ...
1
vote
1answer
246 views

.NET Core localization Web API

I have a Web API application that needs to support localization for multiple languages, and I want to know which approach would be most suited. For simplicity, if I have a collection of books in the ...
0
votes
2answers
312 views

How to use Dependency Injection on repositories in Generic Repository Pattern with base class inheritance

How to dependency inject repositories that inherit an abstract class (that inherits another abstract class) which implements the interface? I will give you a simplified version of my current ...
1
vote
1answer
341 views

Logging to database in ASP.NET Core Entity Framework Core application

I have an ASP.NET Core Entity Framework Core application and I want to implement my own custom logger. I don't want to use ready solutions like NLog or Serilog. I added a new class library project ("...
0
votes
1answer
37 views

keep Controllers at one place or organize by domain

When creating a new .NET Core Web API the controllers will be put in the Controllers directory. I want to create request models for incoming requests (for validation purposes) and response models ...
0
votes
0answers
33 views

Integrating Blazor Client side into an ASP.Net MVC Core 3.1 app. Is it logical or am I better off building new Blazor app from scratch?

I am in the middle of a project building an internal admin web site using Asp.Net MVC Core 3.1 Some of the features I need in the app could benefit from Blazor Client side. (Single Page App features?)...
0
votes
1answer
43 views

Best place to map Model got in ActionMethod

I'm not sure this question matches this forum's purpose, but I didn't think it should belong to the stackoverflow one either, so here it goes: I created a model binder that makes one mapping so "...
0
votes
1answer
210 views

Email via a Microservice

We currently have a monolithic code base which we are in the process of extracting some micro-services where it's obvious to do so. One thing that stands out is our email delivery. We have numerous ...
0
votes
0answers
21 views

Can a common ActiveMQ service be shared in a dev environment without messages being consumed between developers?

Our dev environment is currently sharing an ActiveMQ service hosted on AWS. This however resulted in problems where dev A's service produce a message that will trigger dev B's localhost consumer. Is ...
2
votes
3answers
222 views

Are methods a bad practice on .NET Core EF entity classes?

Say you have the following entity that represent an exact resource from a table, we're talking .NET Core with Entity Framework Core, code-first approach. public class Person { [Key] public ...
-2
votes
1answer
267 views

What is a simple implementation of onion architecture for C# ASP.NET Core WebAPI and SQL db that is not full DDD and CQRS?

I'm a programming teacher. My students learn structured and then object oriented programming in JavaScript and C#. They learn SQL, MS SQL Server, Dapper and EntityFramework Core. After this they ...
0
votes
3answers
80 views

Need advice on reporting with big amounts of data

I have a monolith application in .net core 3.0 with entity framework core 3.0. using: a table with ~3 million records. Its structure is BusinessUnitId | ProfileId | Amount(it has more fields, but ...
3
votes
3answers
174 views

How to clone an object graph and keep relationships of objects intact?

In my ASP.net core application with Angular 2+ client, I work with a complicated object graph. In the object graph I have some objects with references to each other. I have a simplification included ...
0
votes
1answer
178 views

What's a good liveness probe for a Hangfire background job server?

We're in the process of moving everything to K8s and one of our applications is a small .NET Core 2.2 console app that runs a Hangfire background job server. At the moment the app runs as a Windows ...
1
vote
2answers
177 views

Why should I use containers instead of deploying build artifacts directly to Azure App Services or AWS Elastic Beanstalk?

Recently, I have been told by others to look into containerization of my stateless web applications (in this case .NET Core 2.x and 3.1). All of my dependencies are retrieved from public and private ...
-3
votes
1answer
278 views

.Net Core Dependency Injection is an example of anti-pattern?

I want to use Dependecy injection in my new .net core project, but my manager thinks it is an anti-pattern usage. I already know benefits of dependency injection. But my manager cares architecture ...
-1
votes
1answer
290 views

Is it logical to use dependency injection in .net core library project? [closed]

Earlier, we serve with web service but we decide to use dll methods. Because served products are on same machine with common database. So we start to create a library with .net core. This library will ...
1
vote
2answers
87 views

Custom services container for ASP .NET core business layer

My model classes (business layer/library of ASP .NET core solution) uses a number of services (IOrmService, IEmailService, IFileService, IHtmlToPdfConverter etc.). Different models requires different ...
0
votes
0answers
55 views

Which authentication should be used for external users (not registered with the system)

I'm working with a project that uses ASP.NET Core 2.2. The main solution contains different projects, including APIs for a mobile application, APIs to integrate the system with third parties, a web ...
-3
votes
1answer
57 views

How to store a limited set of custom properties without using an EAV Schema

I'm designing a solution in .Net which will be hosted on Azure. I have a system which will allow users to specify custom characteristics for their objects which they will track over time. I am certain ...
1
vote
1answer
364 views

Does Asp.Net Identity worth the overhead?

I'm creating web applications using Asp.Net Core Identity with N-Tier architecture. Lately I've been discovering many properties of this library that I didn't know before as I need to configure the ...
1
vote
2answers
206 views

Is there still a place for non-async methods in Data Repository?

If we start a .NET Core 3.0 project today, which will use database connection (for example ASP.NET Core Web API), is there still a place for non-async operations while talking to the database? Or in ...
0
votes
1answer
124 views

Using WebAPI as infrastructure layer in ASP.NET MVC

I'm starting a new asp.net mvc core project and for my infrastructure layer I'd like to use WebAPI as this layer should be usable in other solutions besides this one. I'm not really experienced with ...
1
vote
2answers
84 views

Looking for clarification on pub/sub systems and how an API gateway comes into play

I'm new to micro service architecture and I'm looking to understand how services should/can interact with each other. The acceptance for my current story requires me to: Email a document Backup the ...
0
votes
0answers
106 views

Is it the right pattern for Razor Pages' private methods to return IActionResult to handler?

Is this a good code pattern in ASP.NET Core Razor Pages, for private methods to return IActionResult to the calling handler? // Public handler public IActionResult OnGet() { var result = ...
1
vote
0answers
137 views

Is ASP.NET Core Identity a leaky abstraction?

As far as I know, the DBContext or underlying persistance technology should be only contained inside the Data layer. Also, it feels very wrong to me to have identity package inside the user ...
0
votes
0answers
38 views

Registering dependency implemented in separate assembly with shared interfaces

Situation: I have a project with a Business Layer (WizBang.BL) that contains nearly all of my application logic. It communicates with a Data Layer (WizBang.Data) that contains by entity classes and ...
-2
votes
2answers
3k views

What is Difference between DTO and Response Object?

What is the difference between a Response Object and DTO in software architecture? Say I want to get a list of Products in a catalog. If ProductDTO is this, how is a Product Response class different? ...