Questions tagged [.net]

The .NET Framework is a software framework for Microsoft Windows operating systems. It includes an implementation of the Base Class Library, Common Language Runtime, and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

Creating a scalable auditing mechanism for SaaS with .net and EF Core

I'm developing the architecture for a SaaS application and I'm designing the auditing mechanism. So far my requirements are the following: Performance 1 Don't want to use DB triggers to avoid ...
0 votes
1 answer
23 views

Is using an Azure Function to forward a message to my App Service the best idea for handling a Twilio Web Hook?

I have an Azure App Service running a .NET (Core) API for an inhouse application, which I'm integrating with Twilio to handle Whatsapp communication. To handle the web hook responsible for receiving a ...
0 votes
0 answers
28 views

Replacement for WCF ServiceBus Relay in .Net 7

We've leveraged WCF Azure Service Bus Relay fairly heavily in the past and have a number of C# services that rely on it. All of these services relay REST requests to small on-site servers that sit ...
1 vote
1 answer
9k views

use of minOccurs="0" without nillable="true" in SOAP

I have received an XSD from a 3rd party supplier generated from a Java based system; which is to be used to create a SOAP endpoint for us to receive data transfers. Their XSD does not make any use of ...
9 votes
1 answer
502 views

Clarification about Event Producer in StreamInsight

I need a small clarification about StreamInsight, I know by doc's that StreamInsight can handle multiple concurrent Events. But will the event producer be a separate function, for ex: I need to watch ...
1 vote
1 answer
219 views

Reduce Code Repetition for a Simple CQRS

We're currently exploring CQRS in our future applications. To give a bit of a background, we use a simple CRUD-style service before something like this. Old Pattern: Controller Command/Service Model ...
1 vote
1 answer
156 views

Why are most of the .NET code analysis rules disabled?

I've began studying how the .NET Code Analysis works. It seems that it can be either enabled via a NuGet package or a property in the SDK-style *.csproj files. Also, starting in .NET 5, it is enabled ...
1 vote
1 answer
157 views

Which is technology is preferably for uploading desktop application usage statistics, SFTP, or HTTPS?

I would like to add functionality to an existing .NET 6, WinForms app (currently migrating to .NET 8 if that is of any relevance), to periodically upload user usage metrics, in addition to providing ...
0 votes
2 answers
140 views

What is considered best practice for managing dependency injection for multiple libraries with ASP.NET Core Web API?

Suppose we are building a REST API with ASP.NET Core. Suppose there are 3 projects in our solution: The ASP.NET Core Web API project. A class library project for the businnes layer. A class library ...
0 votes
1 answer
128 views

Decoupling thirty dependencies for projects that reference each other in a sequence

I am working on a simple interface to SharePoint via Graph API. I have created a project that references Azure.Core, Azure.Identity, Microsoft.Graph, and other dependencies required to make calls via ...
1 vote
2 answers
2k views

Repository Pattern: Doctrine2 vs Microsoft Entity Framework?

I have been using Symfony2 with Doctrine2 for some years. I have recently started using Microsoft's Entity Framework with MVC5. From my Symfony2 experience I understand that a repository's job is only ...
0 votes
1 answer
253 views

Forwarding websocket messages to many clients

I have a wesocket api that constantly send positiondata of many clients as websocket messages. I want to build a web api that connects to the websocket endpoint to receive the positiondata. If a ...
0 votes
1 answer
2k views

Where to put SaveChanges in unit of work?

For the sake of discussion, you can assume I'm using Entity Framework and a mediator pattern implementation in .NET. I'm going back and forth trying to decide how to structure some of my data access ...
1 vote
2 answers
220 views

DDD Logic implementation

Ive been tossing this around in my head for awhile. But I'm working on a project that consists of an Order, that has a OrderStatus. There is quite a bit of logic that revolves around the status and ...
16 votes
6 answers
8k views

Should I Have One Interface Per Class For Unit Testing?

Should I define an interface for every public behavior class (excluding data classes)? I've spent many hours searching and reading to find a clear answer. If I search "Do you define an interface ...
28 votes
6 answers
9k views

Is it worth even checking to see if Guid.NewGuid() is Guid.Empty?

In one of the projects I'm working on the following pattern is seen on a fairly regular basis: var guid = Guid.NewGuid().ToString(); while (guid == Guid.Empty.ToString()) { guid = Guid.NewGuid()....
0 votes
1 answer
225 views

Domain Modeling / Architecture

I'm experimenting with some projects at the moment and I am stuck trying to decide on the correct approach to this question. Given a simple architecture like this consisting of Domain - (Person and ...
0 votes
1 answer
53 views

Best practices for storing logs from worker processes in Azure?

We have a .NET 6 application that consists of a REST API running in Azure App Service, and long-running background jobs hosted in Docker containers. These jobs are triggered by messages in a message ...
0 votes
0 answers
47 views

Decide pattern(s) for Background service which has dependency on services and service-provider and ServiceBus in .net

I'm designing class library with background service which has public static class ServiceCollectionExtensions Which have few methods which will be call outside. Now above mentioned extension will ...
18 votes
3 answers
20k views

Is it ok for services to reference one another?

I have a service that needs information implemented by another service in the same layer. Is it good practice for one service to take a dependency on another service in the same layer?
4 votes
2 answers
1k views

What kind of version change is updating to a new .NET-version when using SemVer?

When updating to a new major version of .NET (in this case from .NET 5 to .NET 6) without needing to make any change other than selecting the new target framework in Visual Studio, does this warrant a ...
2 votes
2 answers
145 views

Where to put interface files for mocking aka what are best practices for organizing interfaces in a C#/.NET Core project with NSubstitute, Moq etc.?

Question I'm working on a C#/.NET Core project, and I'm looking for guidance on organizing interfaces, especially when it comes to using NSubstitute, Moq or other libraries for mocking, because there ...
1 vote
2 answers
164 views

Where to put DLL specific settings?

I'm not sure how to manage configuration settings in a C#/.NET environment. For simplicity lets say I have 3 assemblies: My MainApplication is the project being started and containing the business ...
4 votes
1 answer
900 views

DDD / Onion architecture in JavaScript

One reason I like .NET is because the 'solutions' and 'projects' lends themselves to good architecture. Good architecture makes it easy to follow the happy path of Domain-Driven Design. I've fallen ...
0 votes
1 answer
111 views

What is the responsibility of a typed HttpClient in .NET?

Say I have a simple layered .NET application, with three layers: API Adapters Application The application layer needs to use some typed http clients to communicate with external APIs. This means ...
0 votes
2 answers
673 views

Deserializing/Serializing a cached domain object breaks DDD principles

My application has to maintain a stateful object and update it periodically based on events received. I get an initial HTTP request to create this stateful object. After that the object has to be ...
0 votes
2 answers
144 views

Domain Project and Identity Project circular dependency

I am currently working on implementing the Clean Architecture pattern using Entity Framework. However, I've encountered an issue related to the design of my Domain project. In this project, I need to ...
0 votes
2 answers
1k views

Why does ObservableCollection require all changes to be made on the UI thread?

And is there any danger to making my own INotifyCollectionChanged implementation that doesn't? I'm trying to make a class library contains a Log class, which in turns contains some sort of observable ...
0 votes
0 answers
90 views

How to use an external event queue with inversion of control (IoC)

I'm working on an AspNetCore application, with a requirement to raise and handle certain events asynchronously using an external event queue. I'll use AWS services as examples here because that's what ...
15 votes
5 answers
10k views

Is there a proper way to create a file format?

I'm building a proprietary file format for an application I wrote in C# .NET to store save information and perhaps down the line project assets. Is there a standard on how to do this in any way? I was ...
0 votes
1 answer
185 views

Is a message queue the right pattern to use for intra-module communication in a .net core application

Background Information We have a .Net core application that uses Hangfire (pretty version of cron) jobs to batch process different types of data. As a bogus example, we have one job that will run ...
0 votes
0 answers
764 views

app.config vs. appsettings.json in WPF .NET Framework app

I am building a .NET Framework WPF application, however, I want to use IConfigurationBuilder, which is a part of the newer (.NET Core and up) Microsoft.Extensions.Configuration namespace. My ...
0 votes
2 answers
114 views

Designing inter class tasking in C#

I'm looking for some advice/recomendations on structuring an application which involved multiple classes that need access to each other for the sole purpose of tasking (i.e. class A needs to pass ...
-1 votes
1 answer
156 views

PowerApps with SharePoint Versus ASP.NET core with SQL Server

I have around 6 years of experience in SharePoint, ASP.NET MVC, ASP.NET Core MVC & SQL Server. Now when I want to take a decision, if the project should be implemented using SharePoint/PowerApps ...
-3 votes
2 answers
1k views

Chose between .net 4.8.1 and .net core 6.0 . is the support life cycle an important factor to consider

I want to start developing a long-life ERP system to a customer. now on paper I would chose to develop it using .NET core 6.0 with SQL Server. But one of the main drawbacks which the customer did not ...
20 votes
2 answers
2k views

Why does the .NET framework have no concept of classes as first-class types?

It's well known to those familiar with the history that C# and the .NET framework started out as essentially "Delphi rewritten to feel like Java," architected by the chief developer behind ...
2 votes
3 answers
2k views

Why is it allowed to refer .net framework libraries in a .net standard library?

.Net Standard is specification. There are two popular implementation of the .net standard specification. ie .Net Core & .Net Framework When I create .Net Standard library, I am allowed to refer ...
0 votes
0 answers
202 views

C# Azure Function Durable Function Vs Batch Timer Trigger Function

I have a question related to the best approach when resources are limited, such as on the Azure Function consumption plan. I have an IoT device, and the number of IoT devices is likely to increase to ...
1 vote
3 answers
235 views

Improving performance of C# Azure function

I am currently working on a C# Azure Function that is triggered by an HTTP request. The function's purpose is to extract raw data from Azure Table Storage and output it to the user in the form of a ...
5 votes
5 answers
4k views

How can I protect an SQL connection string in a client-side application?

I am developing a .NET Windows application and I need to make requests to a SQL Server instance. How do I secure the authentication data in my code in case someone decompiles my application? I know ...
0 votes
1 answer
264 views

Separating Application (Business Logic) Layer to Multiple Module Layers in Clean Architecture

Currently, I'm designing the Project based on Clean Architecture composing with 4 layers: Domain Application Infrastructure Presentation Since the project is pretty huge, I'm now considering to ...
10 votes
1 answer
3k views

Separate namespace just for exceptions?

I was doing a code review and came across something odd which I've never seen before. The developer decided to create a sub-namespace just to contain all the assembly's exceptions. I thought I had ...
3 votes
2 answers
510 views

Direction to take to improve a AST interpreter

I'm looking for some opinions/advices about a particular subject. Here is the situation : I'm developing for fun, in my spare time, a programming language interpreter made in C# and I'm looking for ...
0 votes
1 answer
59 views

Including currect user/roles data within object state in .Net applications to control object behavior

I am building a .Net Core Blazor Server application. The application creates records of a Project class which move through a workflow with various phases of review and acceptance/rejection before ...
4 votes
1 answer
928 views

Should I favor default interface methods over extension methods?

Default interface methods of C# 8 and extension methods have in common that you can "add" a method with implementation to an interface. "Add" being in quotes here because for ...
5 votes
2 answers
5k views

Why does a custom action filter need to inherit from both ActionFilterAttribute and IActionFilter?

I m first time creating a custom action filter and following this link http://www.asp.net/mvc/overview/older-versions/hands-on-labs/aspnet-mvc-4-custom-action-filters They are saying to Extend ...
1 vote
2 answers
551 views

DDD - How to handle one transaction across multiple bounded contexts when doing Save on multi-purpose UI page

I'm working on a HR application that has employee management and access control. We decided to go with these bounded contexts: Employee management: manage employees information, like name, contract, ...
0 votes
1 answer
906 views

ASP.NET Core - Using Partial Views inside a Modal window for my Add/Edit/View Details screens?

I've been developing .NET projects for the past 3 years, and on my recent web .NET projects, I've been using Partial Views for all the screens that contain Forms for Add/Update/Delete or other ...
0 votes
1 answer
592 views

Azure Function App and multiple Functions within it, performance

I am new to Azure Function App. I am using a consumption plan. Does it make a difference how many functions are in a Function App? What about if there are functions, such as the service bus triggered ...
3 votes
1 answer
3k views

Why does the Windows Clipboard require an STA thread?

To copy something to the clipboard in Windows (at least in .NET as far as I know) it has to be done on a separate thread that is in STA Mode. One example I have used is this. Thread thread = new ...

1
2 3 4 5
29