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
0answers
83 views

c# Is using the assertion method bad or not for clean code?

I'm reading Uncle Bob Martin's Clean Code and now I have a question about the code I wrote. Is using a method as an assertion method a good or bad practice for clean code? Example // Simple example ...
0
votes
0answers
24 views

Designing ABAC-style Authorization module with Row-level security

I'm designing the Authorization part of the AAA module of a business software suite. Requirements: There are Users and Groups, and you can assign Permissions to any of those. You can Grant or ...
0
votes
3answers
108 views

Modern methods to run a Console Application on schedule [on hold]

I've got a console application which pretty much interacts and prepares some data in a SQL Server Database, exports a table, encodes, gzips and uploads to an AWS S3 bucket. The application is complete ...
19
votes
3answers
2k views

Should wrappers compare as equal using the == operator when they wrap the same object?

I'm writing a wrapper for XML elements that allows a developer to easily parse attributes from the XML. The wrapper has no state other than the object being wrapped. I am considering the following ...
-1
votes
1answer
77 views

Should Specification Patterns return IEnumerable, IQueryable, or Expression?

We are implementing Specification Patterns with Domain Driven Design. Company architect also wants us to utilize Generic repository (not my choice). Currently require specification Pattern for Filter ...
0
votes
1answer
96 views

Which Software Layer should hold Pagination Information?

Which layer should hold pagination information? (Page Size, Page Number), Eg say 100 products, 5 product per 20 pages. User can type in API url layer. api/Product?Page=1&Limit=2&ColumnSort=...
1
vote
1answer
36 views

How to properly handle deployment configuration for Xamarin Forms app

We are currently working on a Xamarin Forms (.NET Core) application. We use Microsofts DevOps for the code repo, building and deployment. Since we want to test newly developed features in a safe ...
0
votes
1answer
73 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 ...
1
vote
2answers
80 views

Downloading and appending data from AWS S3 whilst avoiding clashes

I have to upload a TSV file to an S3 bucket, the content is form submission data. Another service will consume and do things with this data as soon as possible. The service would like one large file ...
0
votes
0answers
51 views

Need some design advice on my ORM for Immutable objects & ref passing

I'm adding Immutable objects support to my Micro ORM called "Symbiotic" In the case of a create, I need to pass back a newly created version of the value passed in because the object is immutable and ...
1
vote
1answer
53 views

Micro-services architecture for Data Ingestion/Transformation pipeline project

I am working on designing a brand new Data Ingestion Pipeline with the Key highlights of the new project are as follows: Download and Update data to/from SharePoint using SharePoint APIs Download and ...
0
votes
1answer
54 views

When to use type contraints for sortable collections

I am implementing a Binary Search Tree and cannot decide if it would be good practice to constrain the generic type of the tree to a comparable item, i.e. IComparable<T>. Or, to just use the ...
0
votes
2answers
101 views

How to initialize base class property once instead of passing it from all derived classes?

I have a small library where I am performing 1 long running operation and based on that operation,I am saving some data inside database tables.Now this is small library which does not include alot of ...
0
votes
2answers
122 views

SRP violation confusion based on examples

I am trying to gain better understanding on SRP and when I was checking out a Pluralsight video by Scott Allen, I saw code like this: https://github.com/OdeToCode/cs-fundamentals/blob/master/src/...
0
votes
0answers
51 views

Synchronization data between API (server) and local database : C#

I hit an API which gives a list of chairs with their location. I save this data in my local database. Whenever I received updated data like add a new chair, update location of the chairs and delete a ...
0
votes
1answer
74 views

Should we still create separate custom ApplicationExceptions?

Given that when is supported in try...catch blocks, does it make sense to create a single CustomApplicationException class, say, with an enum ApplicationExceptionReason Reason property to ...
2
votes
4answers
410 views

Why does C# not have automatic dispatchers

Why does C# make you put in a dispatcher for a different thread to update the UI? Example: Dispatcher.Invoke(() = { lblerrorName.Content = ""; }); It always gives the 'running on different ...
0
votes
2answers
87 views

Passing runtime-read configuration when working with an IoC container

I've recently "discovered" the IoC realm, and decided to refactor a project I'm working on to use such a container. To be specific - I'm using autofac in C#, in a .NET Core console application. The ...
0
votes
0answers
111 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 ...
3
votes
1answer
139 views

Way to hide logic behind class for better readability of method and refactor class to follow SRP

I have an algorithm to create a version for an entity and then I save that version against below 2 entity: 1) Variant 2) Category interface IEntityVersion { string GetVersion(); } public class ...
1
vote
1answer
129 views

NuGet versioning with gitflow

Some background information to our actual situation. We are migrating from TFS VC to git. We've a ASP .NET Web API with many different Controller Libraries (>30 assemblies). Many of them are ...
2
votes
1answer
177 views

Must we define methods and async when we don't know whether the implementation is synchronous or asynchronous?

I think I know the answer to this, but it's particular enough that I don't want to go telling other people stuff until I'm 100% certain. Suppose I have a class with some dependency: public interface ...
0
votes
1answer
81 views

Appropriate pattern for injector that sets a property and client that ONLY gets a property

Suppose I have a method in client code that expects an interface... void DoWork(IDataManager data) { //use IDataManager interface in the DoWork method } And the IDataManager interface looks like ...
2
votes
1answer
170 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
123 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 ...
54
votes
6answers
13k 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
80 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
1k 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
116 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 ...
4
votes
4answers
330 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
54 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
95 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
152 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
327 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
282 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 ...
20
votes
3answers
838 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
152 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
406 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 ...
2
votes
1answer
1k 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
264 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
238 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
110 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
56 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
402 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
153 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
60 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
155 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
357 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 ...