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 [.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++.

1
vote
1answer
75 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 ...
1
vote
1answer
81 views

Data entities in Onion Architecture

I'm trying to build a project using onion architecture (just a "Northwind"ish type app to get more up to speed with .NET Core). I also want to get a better grasp on Onion Architecture principals. I ...
52
votes
6answers
12k views

How to deal with fear of taking dependencies

The team I'm in creates components that can be used by the company's partners to integrate with our platform. As such, I agree we should take extreme care when introducing (third-party) dependencies. ...
1
vote
1answer
76 views

How to work with multiple databases efficiently (Development, Testing & Production)

Brief background I'm currently designing a COM DLL in .NET for use in MS Access by a few other developers. The Access application is hooked up to a SQL-Server & is supposed to just act as a front-...
0
votes
4answers
337 views

Is it possible to infer the the generic type from a generic method?

I'm making an HTTP API client class. I want a Perform() method which takes a request object and returns an obejct that is expected from the API. So a PostRequest object will describe how to get a ...
0
votes
1answer
98 views

Does a 'leaky' repository implementation defeat the point of a repository?

I've seen some tutorials and examples of implementing a repository pattern, and I don't quite understand something. My impression was that the whole point of a repository pattern was to hide the ...
-1
votes
0answers
14 views

How do you cater for AND and OR searches in a WebApi query string using Get in C# [migrated]

How do you cater for AND and OR searches in a WebApi query string using Get in C# For example, for searches such as firstName=John OR firstName=Simon AND Country=UK OR Country=Canada OR LastName=...
3
votes
4answers
138 views

Refactoring ASP.NET Web Forms App to use MVP vs incrementally rebuilding it using MVC?

My team has inherited a Web Forms application that was built over the past decade or so into a monolithic code base with massive dependencies. In order to maintain this system we are going to have to ...
0
votes
0answers
44 views

Separate Class for Current User vs List of Users?

Suppose I have system with a User class, meant to represent one row in a database table of users of the system. There will be queries for the administrator's screen reading a list of all users, in ...
0
votes
1answer
61 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 ...
0
votes
1answer
117 views

Factories to create same objects with different data sources

I have several handlers classes that implements same interface and factories to create handlers. Handlers: public class Handler1 : IHandler { private readonly IService1 _service1; private ...
0
votes
7answers
310 views

Good object oriented practice to use an object to build itself?

Do you think its a good OO practice to use parts of an object to build itself? Here is an example. var car = new Car { Make = BuildMake(), Model = BuildModel(), Vin = ...
1
vote
3answers
171 views

What is difference between assigning to auto-Implemented properties VS their backing fields within the class

Before I started using auto-implemented properties, I was taught that when assigning properties in the constructor (because of the potential of making a property read only), I should assign directly ...
15
votes
2answers
455 views

C# 8 non-nullable references and the Try pattern

There is a pattern in C# classes exemplified by Dictionary.TryGetValue and int.TryParse: a method that returns a boolean indicating success of an operation and an out parameter containing the actual ...
1
vote
1answer
84 views

Securing cross DLL references within an Application

I am developing a. NET application. One of my DLLs manages all the security (data encryption, license management, etc). I was wondering if someone could somehow substitute this DLL file with one of ...
4
votes
5answers
363 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 for ...
0
votes
1answer
237 views

Clean Architecture and Microservices

Our team is in the planning stages of creating an enterprise solution for our back office. Our goal is to have one singular entry point for common tasks, such as changing an address or reprojecting a ...
0
votes
1answer
65 views

Entity Framework and static entity instances

I'm always having the problem on how to properly design having static entity instances and it being attached to Entity Framework's Dbcontext. For example, we have the following: using Microsoft....
-2
votes
1answer
17 views

Migration Of Demo Version Projects to Live Version in .Net MVC Applications

I have an application which is currently used by clients. So based on the feedback from the client, normally we are fixing bugs in a live application.Parallel I am adding new modules to demo projects....
-2
votes
1answer
120 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 ...
3
votes
1answer
74 views

.NET shared libraries across team, using TFS and auto-NuGet publishing

My team and I had a discussion about our future architecture, since we've always just written the code that was needed in each separate project, which have now led to extremely redundant code across ...
0
votes
1answer
47 views

How would I use Azure Container Instances to parellelise a task?

I currently have a file processing task that runs on an on-prem VM, it's a .NET executable that also calls other services such as ffmpeg (for videos). As is, the task runs fine, but it's really only ...
1
vote
1answer
149 views

.NET Core Microservice messaging with Amazon SNS and SQS

So I've done some searching but can't seem to find a whole lot of suggestions on this topic. My question is what are some opinions on the best way to receive messages from an Amazon SQS queue on a ....
2
votes
1answer
58 views

Strategies for managing a dynamically sized pool of worker processes?

I have a problem to solve that's very much like a thread pool, and I was hoping to hear some strategies or find some resources to information on managing the size of the pool. Let's say I have the ...
0
votes
0answers
15 views

Pass Data From SSIS To External Component

I currently have an SSIS package whose final task is a Script Task which works with data in a DataTable. I need to add the following functionality: Execute an external batch component that will use ...
1
vote
2answers
48 views

Encapsulating Permissions Logic, but looking to Avoid Circular Dependency

I'm trying to encapsulate permissions logic for a particular view model in a way that the permission logic has access to the view model object, but is also exposed inside of it Trivial Implementation:...
2
votes
1answer
147 views

Is my Architecture correct?

I have a question about architecture in .NET. My architecture is like this : Projet : - DAL (Data Acces Layer) - BLL (Business Logic Layer) - DTO (Data Transfer Object) - IHM (man/machine ...
0
votes
3answers
176 views

How can I interpret a SQL Check Constraint inside my C# .NET class libary?

I was given a more or less complex task. The goal is to interpret a SQL Check Constraint inside my C# .NET libary. In our case we have a simple UI that displays what is inside the database. We do not ...
0
votes
1answer
251 views

How can I get rid of this antipattern

I have a main window and I amgetting data from http client service while form load. public class MainWindow: Window { private IClientService service; public MainWindow(IClientService service)...
1
vote
1answer
93 views

Problem with business and data access layer design

I am creating a library to interact with third party api.This library will be wrapper around that third party library and i want to expose my wrapper methods to client(webapi,winform,console,mvc etc..)...
0
votes
1answer
52 views

Distributing C# Dlls to Customers on Application Install

I am currently working on a software library that will be used to develop Class Libraries. These class libraries can be run by our application running on the user's machine The application uses the ...
0
votes
1answer
154 views

Am I breaking some Onion Architecture rule?

Based on the project structure below i will have some questions Domain Layer 1) MyApp.Domain.Entities (DLL) Product.cs PagedResult.cs Referentes No References 2) MyApp.Domain.Interfaces (DLL) ...
-1
votes
1answer
101 views

What are pattern and practices or frameworks for Managed Extensibility Framework? [closed]

Are there any frameworks for using MEF, for example for WPF application there are number of frameworks to save time, but what is there for MEF? are we to start every MEF application from scratch or is ...
0
votes
2answers
451 views

Naming conventions for .net C# Unit test projects for better sorting [closed]

I currently use the following naming scheme for my unit test projects.. if I have a project "MyApp", I will have.. -- MyApp -- MyApp.Tests I see this is quite a common practice. Now, the problem is,...
3
votes
3answers
244 views

what is the best way to write a recurring code with different enums

Basically what this code does is to determine whether the user is allowed access to the page or not from list of pages as enum, each one has the role name as its name and the page name inside it. The ...
2
votes
0answers
167 views

How can I resolve circular dependency within service layer in a n-tier architecture system?

I am currently starting a new project with a 4-tier architecture design. The layers is set as follow. +------------------+ +---------...
1
vote
0answers
22 views

DataTable Processing: Want lowest result

(Hi there, not entirely sure if this is the right place to ask, sorry if it isn't!) I am knocking up a fairly quick and dirty Visual Basic.NET application that essentially is a DB UI for my day job, ...
1
vote
1answer
143 views

Using “On” at the start of a method name

From what I've observed, methods that start with the word "On" fall into two categories: A base class that defines an event will expose a protected method whose name starts with "On" followed by the ...
20
votes
3answers
825 views

What is the purpose of this apparent self reference in C#?

I am evaluating an open source CMS called Piranha (http://piranhacms.org/) for use in one of my projects. I found the following code interesting and a bit confusing, at least to me. Can some help me ...
3
votes
1answer
114 views

Regulations about collecting data from software running at clients hardware (apps 'phoning home') [closed]

We develop an application which has now been installed on a few thousand customers sites. Unfortunately, we have no customer data collection built into the software. This is something we want to ...
1
vote
2answers
83 views

Is it okay for async function to update a common object

I have a couple of functions, each function verifies a set of rules and updates a common object. The common object is just a container that holds a list of rules that passed or failed. I would like to ...
1
vote
0answers
57 views

Wrapper method for ConfigureAwait(false)?

Does it make sense to declare a async method as private and then create a public method to act as a wrapper that calls the private method with ConfigureAwait(false)? The intended purpose is design an ...
-1
votes
2answers
200 views

Argument for staying on Rails instead of migrating to .net MVC?

I work for a Rails SaaS platform that was recently acquired by a primarily Microsoft shop. They are pushing the issue we need to rewrite the entire application in .NET. It's very clear they know ...
-1
votes
4answers
425 views

Alternatives to Long Loops [closed]

I am part of a software team that is writing a console application (no UI) in C#. My part in the team is to write code to call RESTful APIs from a third party site, process the returned data and save ...
3
votes
1answer
150 views

Single responsibility of Program class in C#

I do not follow SOLID strictly in general, but I do try making sure to separate responsibilities of my classes. I was developing a small app with a Windows service powered by Topshelf and realized ...
0
votes
2answers
227 views

How to create secure desktop installer that doesn't trigger a virus alert for unknown exe?

When I created a c# desktop application and move the exe file to another computer that has anti virus security, the security program shows an alert as unknown exe. I want to create a desktop ...
-1
votes
1answer
218 views

Giving Viewmodels access to application wide Model in MVVM

I am practicing building applications using MVVM and WPF+C# by making a "finance application". The application contains several views with their own ViewModels. The views are in a hierarchy and are ...
3
votes
3answers
493 views

Multithreading ( thread per area ) for an MMO server, good idea?

As a personal project, I'm setting up a MMO, and writing the server in C#/.NET Core. As of now my architecture is as follows: The world exists of different areas ( you can go from area to area trough ...
4
votes
1answer
237 views

How to have multiple source copies of a dependency in a C# git project?

In our company, we develop information system software in C#.NET, which has client-server-module architecture. Module project does not depend directly on server/client project, but only on shared ...
41
votes
13answers
12k views

Is it unreasonable to expect Any() *not* to throw a null reference exception?

When you create an extension method you can, of course, call it on null.But, unlike an instance method call, calling it on null doesn't have to throw a NullReferenceException -> you have to check and ...