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
0
votes
0answers
2 views

How to get the data in database and bind the dropdown list?

How to get the data in database and bind the dropdown list? how can bind to the dropdownlist. Please any one help me.
0
votes
1answer
39 views

Domain Driven Design: Is OrderLine Detail a Nested Class of Order Header?

I had asked a question here, and someone had recommended that OrderLine be a Nested class within Order Header. Is that a standard practice in Domain Driven Design, or more one of many debated methods ...
0
votes
2answers
84 views

Hosting a standalone .Net Core Web Application

We've created a .Net Core Web Application and are deploying it as a stand-alone exe. The main reason for deploying it stand-alone was to not be dependant upon the version of .Net Core installed on the ...
-1
votes
0answers
30 views

API Gateway + Client App in production [closed]

I am currently embarking on my first SaaS microservices-based application, built with .NET Core and Docker containers, but there is something I am struggling to get my head around, how would things ...
0
votes
1answer
55 views

Checking tenant information in microservices

I am currently trying my hand at a microservices architecture for the first time, and I am looking to put together a multi-tenant application built on a this architecture. Tenants are created with ...
0
votes
1answer
89 views

Are resource files (.resx) secure?

I have a resource file called AppSecrets.resx, and the bit of code below to check the login credentials of the "super duper admin user". This admin user is distinct from normal admin users, as it is ...
0
votes
0answers
84 views

How can I economically scale to 100+ instances of my .Net Core app without using 1 container per instance?

Currently I have a .NET core application, which fires up a new thread to hold each customer account. Each thread instance: Is long running for many months or more Holds open SignalR Websockets and ...
2
votes
2answers
239 views

C# extension methods design patterns and usage guidelines?

C# extension methods have seen a rise in usage over recent years. The offical microsoft guidelines on usage state: "In general, we recommend that you implement extension methods sparingly and only ...
0
votes
0answers
13 views

how to work with variable data structures and templates

I need users to be able to create an organization which will have some preset fields such as Name, Address, and Type. But depending on the type, the organization can have type-specific fields such as ...
3
votes
2answers
167 views

How should domain services be referenced?

I'm working on a test project, with the intention of using DDD. So far I have this basic project structure: My question is: How should the Core.Domain.Services be referenced? do I create an ...
0
votes
0answers
21 views

Difficulty understanding the purpose of ViewComponents in MVC

I've thrown some of these into my new MVC project for pages where I need 'widgets' on the screen that are on multiple pages. But I'm thinking of scrapping them and using RenderAction instead. All my ...
1
vote
0answers
42 views

Extending IdentityUser with nullable foreign key to another IdentityUser

I'm working on a framework which builds on .net core Identity. Let's say I wanted to extend the IdentityUser<TKey> class with a ParentUserId property while the developer should still be able to ...
0
votes
0answers
108 views

Tradeoffs between Testability and Performance when filtering using SQL vs LINQ

My team has recently decided to adopt the CQRS pattern similar to the one used in the famous Microsoft EShopsOnContainers repository. In this solution, the queries are made in Query classes using ...
0
votes
2answers
100 views

Should I put the messages for business logic validations in API?

I have a REST API written using ASP.NET Core Web API. There are a few business logic based messages I want to send to the clients from the API. I am in a dilemma on which of the following ways I can ...
0
votes
0answers
23 views

Authentication, bussiness logic and several entities in asp.net core

I'm working on an asp.net core application, using Identity as authentication/authorization management. Depending on the role the user can do "some thing", this is the normal way of authorization. But ...
1
vote
1answer
161 views

If we are allowing anonymous users to register inside our web site, how we can prevent hackers from occupying others' email address

I am planning to start a new asp.net core MVC web application. One of the features we are having is that anonymous users can register inside our web application by entering their email addresses. then ...
3
votes
0answers
123 views

Clean Architecture - What is the difference between Use Cases and Core Services?

I'm trying to apply Clean Architecture to a simple ASP.NET MVC Core app by following Microsoft's ASP.NET architecture guidelines and their eShopOnWeb sample project. In the standard Clean ...
3
votes
1answer
144 views

Internationalization in .net core

I am currently in the process of developing an ASP.NET Core application which requires internationalization to Russian. I have been reading over the documentation that Microsoft provide for .NET Core ...
0
votes
0answers
153 views

EventSourcing / CQRS Implementation with ASP.NET Core WebApi and Azure Cosmos DB

I was looking for an easy implementation of the Event Sourcing and CQRS Pattern in ASP.NET Core using Azure Cosmos DB as Event Store. As I couldn't find anything appropriate I decided to write a ...
0
votes
1answer
87 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
142 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
33 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
217 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
112 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
160 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
213 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
76 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
355 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
98 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
1k 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
213 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
205 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
1k 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
236 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
184 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, ...
5
votes
1answer
2k 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
114 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
609 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
552 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
38 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
52 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
73 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
1k 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 ...
3
votes
4answers
2k 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
971 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 ...
30
votes
5answers
14k 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
4answers
1k 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
436 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 ...