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

What is Difference between DTO and Response Object?

What is the difference between a Response Object and DTO in software architecture? Say I want to get a list of Products in a catalog. If ProductDTO is this, how is a Product Response class different? ...
0
votes
1answer
60 views

What is the Difference between Reactive Extensions and Message Queue?

I am trying to understand the difference between Reactive Extensions and Message Queue? Are they competing frameworks? Can they be used in conjuction? Started programming, and trying to understand ...
0
votes
1answer
28 views

How to design a repository when datasource differs based on DML/READ operations?

We are starting our new application in which we using MS SQL DB for all our insert/update/delete/select ie. both SELECT and DML operations. But, soon we will have two different sources. SQL Server ...
29
votes
7answers
7k views

How to treat unhandled exceptions? (Terminate the application vs. Keep it alive)

What is best practice when a unhandled exceptions occurs in a desktop application? I was thinking about to show a message to the user, so that he can contact support. I would recommend to the user to ...
2
votes
2answers
198 views

Throw Custom Exception

First, I know - there are a lot of online resources that talk about the topic Exception handling - but yet there is still something that's unclear to me. Consider having this code in an external ...
0
votes
0answers
147 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 ...
-1
votes
3answers
77 views

Is it wise to locally debugging a solution with a framework version that differs from production's?

A small, neglected project has recently been reported by users as having time out errors and some object reference exceptions. As I am a recent replacement for a developer who was responsible for this ...
5
votes
1answer
3k views

Does omitting await keyword once in the call stack break the asynchronous behavior of the whole stack?

Call stack may contain several methods returning Task. If all of them are decorated with async, the flow of execution is quite simple. However, what if one of them is not awaited - are other method ...
0
votes
1answer
218 views

Enterprise Mashups. A good approach for .net

I'm in the middle of trying to talk our management into letting us do a portal that sits across the many, many systems that we use. I believe in using the best tool for the job so we have a good ERP, ...
3
votes
0answers
94 views

Daylight savings time for real time application

I am building an application on windows forms C# that will run in real time 24 hours a day 365 days a year. This application tracks the time that components are out of storage. I am running into a ...
0
votes
1answer
89 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 ...
1
vote
1answer
208 views

Isn't asynchronicity an implementation detail?

Consider a simple — and fake — interface: interface ISuperGetter { Super Get(); } An implementation would get some Super from RAM. On would store what it needs on disk. Yet another could fetch the ...
3
votes
1answer
4k views

Choosing between Web API and DLL reference

I am confused between choosing Web API or DLL reference for a project I am working on and want to understand recommendations for both the approach. We are having a Web API which exposes an interface ...
8
votes
1answer
891 views

Injecting data processing logic into class

I want find more elegant and appreciate way to inject processors into CommandProcessorDispatcher class. Or it can be another one solution (the goal is separate each command processing logic to ...
1
vote
3answers
319 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 ...
1
vote
2answers
201 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 ...
1
vote
1answer
40 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 ...
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 ...
2
votes
0answers
28 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 ...
14
votes
5answers
13k views

Refactoring constructor that has too many parameters [duplicate]

I'm in my first two months as a software engineer and just wanted to get advice on if this can be improved upon. I've created a class that represents data from RFID in the form of a message: class ...
3
votes
1answer
180 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 ...
24
votes
6answers
25k views

Why would you ever 'await' a method, and then immediately interrogate its return value?

In this MSDN article, the following example code is provided (slightly edited for brevity): public async Task<ActionResult> Details(int? id) { if (id == null) { return new ...
1
vote
2answers
336 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 ...
2
votes
2answers
466 views

Transitioning to asynchronous programming model

Our team is mantaining and developing a .NET web service written in C#. We have stress tested the web service's farm and we have evidence that the actual architecture doesn't scale well, as the number ...
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 ...
-1
votes
1answer
83 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 ...
21
votes
3answers
950 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 ...
0
votes
1answer
112 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=...
0
votes
1answer
76 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 ...
4
votes
1answer
832 views

Writing a Compiler - .reloc section of the COFF

I'm looking for a little bit of direction in writing a compiler. I've written in Common Intermediate Language, C#, and various other .NET languages; I've written my own Metadata Parser and now I'm ...
1
vote
1answer
5k 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 ...
7
votes
1answer
413 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 ...
2
votes
1answer
56 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 ...
1
vote
2answers
88 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 ...
4
votes
1answer
489 views

.NET developer needs FoxPro advice [closed]

We have a prospect with FoxPro 2.6 (whatever it means) system. Our product integrates with other systems by the means of triggers (usually). We would place couple of triggers on X system and then ...
2
votes
1answer
164 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 ...
13
votes
5answers
16k views

How to ensure a single coding standard in .NET with tool support

Probably, the basic situation is familiar to everyone. You have agreed on certain coding standards in your team and now it is time to make sure that everybody follows them. Some do it via heavy ...
-1
votes
3answers
167 views

When should an order be created in a webshop [closed]

Let's say I want to make a webshop, which sells custom mugs (for the sake of simplicity). In the shop, you go through 3 steps: Select cup size Select color Add a logo And then finally it is added to ...
16
votes
11answers
4k views

Why all classes in .NET globally inherits from Object class?

Its very interesting for me which advantages gives "global root class" approach for framework. In simple words what reasons resulted the .NET framework was designed to have one root object class with ...
0
votes
0answers
54 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 ...
6
votes
5answers
16k views

What ESB systems work the best for .Net stack [closed]

What Enterprise Service Bus would you use and why?
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
104 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/...
8
votes
8answers
3k views

Is using something other than XML advisable for my configuration file?

I have a small tool I'm designing which would require a configuration file of some sort. The configuration file in my case is really more of a database, but it needs to be lightweight, and if needed ...
140
votes
8answers
22k views

Are bad programming practices typical within the software industry? [closed]

I just started my first job as a software developer over a month ago. Everything I have learned about OOP, SOLID, DRY, YAGNI, design patterns, SRP, etc. can be thrown out the window. They use C# .NET ...
1
vote
1answer
443 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 ....
0
votes
0answers
54 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 ...
2
votes
1answer
181 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 ...
26
votes
5answers
28k views

When and why to use Nested Classes?

Using Object Oriented Programming we have the power to create a class inside a class (a nested class), but I have never created a nested class in my 4 years of coding experience. What are nested ...