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
1 answer
24 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 ...
jarodsmk's user avatar
  • 141
0 votes
0 answers
35 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 ...
Molloch's user avatar
  • 101
1 vote
1 answer
162 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 ...
Gua-naiko-che's user avatar
1 vote
1 answer
159 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 ...
mountainred's user avatar
0 votes
2 answers
146 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 ...
user1969903's user avatar
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 ...
KryptoBeard's user avatar
0 votes
1 answer
131 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 ...
Sigmundur's user avatar
  • 109
0 votes
1 answer
56 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 ...
hingst's user avatar
  • 29
0 votes
0 answers
48 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 ...
C M's user avatar
  • 1
2 votes
2 answers
152 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 ...
rklec's user avatar
  • 31
1 vote
2 answers
166 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 ...
NoConnection's user avatar
0 votes
1 answer
116 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 ...
Jakob Busk Sørensen's user avatar
0 votes
2 answers
708 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 ...
user1890098's user avatar
0 votes
2 answers
151 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 ...
pakerinjo's user avatar
0 votes
0 answers
91 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 ...
brads3290's user avatar
  • 135
0 votes
1 answer
187 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 ...
dot's user avatar
  • 541
0 votes
1 answer
268 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 ...
LBats's user avatar
  • 9
0 votes
0 answers
802 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 ...
JD136's user avatar
  • 1
1 vote
1 answer
220 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 ...
Lawrence's user avatar
  • 123
-3 votes
2 answers
2k 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 ...
microsoftdeveloperdesigner's user avatar
-1 votes
1 answer
159 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 ...
microsoftdeveloperdesigner's user avatar
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 ...
Darc's user avatar
  • 101
0 votes
0 answers
205 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 ...
user8400863's user avatar
1 vote
3 answers
236 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 ...
user8400863's user avatar
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 ...
Motti's user avatar
  • 85
0 votes
1 answer
276 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 ...
Steve.NayLinAung's user avatar
0 votes
1 answer
60 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 ...
aterbo's user avatar
  • 111
1 vote
2 answers
567 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, ...
Ramzi Hammouda's user avatar
0 votes
1 answer
227 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 ...
Justim Odendaal's user avatar
0 votes
1 answer
600 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 ...
user8400863's user avatar
2 votes
3 answers
305 views

C# Duplicated usage of an if/else condition and a ternary operator. A good practice?

I had a debate with a work mate regarding the following code as to which one of it would be the better practice: My code (in pseudo): var A = <precondition either TRUE or FALSE>; var B; if(A) { ...
Chams's user avatar
  • 29
-1 votes
1 answer
1k views

How are parameters values passed into a MVC controller constructor?

For this MS sample code, I have checked Program.cs, Startup.cs, and other config files, don't see how the two parameters sqlQueryService and sqlCommandService are populated. Appreciate if someone can ...
Jeb50's user avatar
  • 101
4 votes
1 answer
943 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 ...
bitbonk's user avatar
  • 211
0 votes
1 answer
134 views

How handle many files effectively?

I'm looking for a way to work with a huge amount (~10^9) of files (all sizes) in .NET using unspecified file system (NTFS, BTRFS...). What I have done up to now is to store them in evenly in a folder-...
Andreas Zita's user avatar
0 votes
0 answers
812 views

How inter-process communication is handled on .NET Core?

I have to implement a bi-directional communication between two local process with support to backward compatibility .NET Core/NET Framework and platform architecture x86/x64. The options that i have ...
youssef jirari's user avatar
0 votes
0 answers
63 views

What's a suitable pattern for handling multiple versions of PDF layouts?

I have a class responsible for generating a PDF. The class takes an existing PDF template and builds multiple pages. Each page has various elements that are inserted/manipulated. I now need to handle ...
monkeySeeMonkeyDo's user avatar
0 votes
0 answers
103 views

How to avoid duplicate code when working with SOAP proxy classes in different environments?

It's been a long time since I worked with SOAP so my question might be trivial but I just wasn't able to find a satisfying answer so far! Anyways here's what's going on: I got access to a system via ...
LazarQt's user avatar
1 vote
3 answers
2k views

When Should I Use a Static Class and When Should I Just Use Functions?

I am currently building a C# application that gets JSON data then it calculates something then stores the results in a database, what is the proper way to design the application. This is how it's now ...
BeeFriedman's user avatar
-1 votes
3 answers
656 views

Refactoring multiple non-nested if statements [C#]

I have a number of non-nested if statements that look like this: if (!bytes[nameof(PropertyVersion.Price)].SequenceEqual(dbBytes[nameof(PropertyVersion.Price)])) changes += $"Price {TextHelper....
Azhari's user avatar
  • 115
2 votes
1 answer
188 views

Proper orchestration of NServiceBus sagas

I'm seeing two ways of orchestrating NServiceBus sagas. I'm not familiar with it so I'm trying to understand if they are just two alternative ways of doing the same thing or if I should follow one or ...
Scott Hannen's user avatar
  • 1,014
0 votes
0 answers
122 views

Best practices when it comes to extending Service collections in .NET for dependency injection

Most of the information that I can find online is about how to do basic dependency injection in the common flows. eg one DI container where services are registered. For a project we are writing a ...
Robin's user avatar
  • 103
2 votes
0 answers
72 views

Best approach for several steps with user input in between

I've read several questions and I couldn't find one specifically similar to mine. I also don't think there's a design pattern for this situation as I think my system is a legacy system and don't fit ...
Rick Wolff's user avatar
1 vote
1 answer
1k views

Correct IHttpClientFactory implementation with dependency injection?

In Microsoft's documentation, in the Named Clients example, they retrieve an HttpClient from the IoC container: var httpClient = _httpClientFactory.CreateClient("GitHub"); In the Typed ...
chrisxfire's user avatar
1 vote
1 answer
605 views

DDD - Modelling a system of groups and users

I'm looking for some advice on a system I'm designing, at its core it will allow users to create/join/manage groups of users. I thought it would be a good idea to try and apply some DDD principles, ...
Astronought's user avatar
1 vote
2 answers
636 views

C# - Class creating instances of other classes requiring different services

Context I have a service class whose sole purpose is to interact with a specific API, let's say the Automotive API. The API mostly works with generic AutomativeRecord which basically represents a ...
Union3008's user avatar
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 ...
Rsge's user avatar
  • 61
0 votes
3 answers
246 views

Hardcoding endpoints in library alternative

I'm dealing with creating a few internal libraries for a project that can offload emails and logs to a queue (Service bus, storage queue). The issue I'm having is how to configure the the queueing ...
KryptoBeard's user avatar
0 votes
1 answer
741 views

How to implement automatic SemVer from code changes [closed]

Goal I'm working on libraries published as nuget packages and I would like the version of those packages to update automatically based on the changes I make. In other words, I would like something ...
Batesias's user avatar
  • 234
1 vote
1 answer
684 views

Alternatives to DDD - Complicated and cumbersome business logic/process

We have inherited a legacy MS CRM 4.0 application and the business wants it re-written to an as vanilla as possible .NET web application. The business wants to go down this route vs another off-the-...
David's user avatar
  • 153
5 votes
4 answers
9k views

How to get an ILogger instance from extension methods?

Let's say I have this service abstraction exposed from a library. public interface INavigator { ImmutableList<IPageViewModel> Entries { get; } void NavigateForward(IPageViewModel page); ...
Batesias's user avatar
  • 234

1
2 3 4 5
29