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
1
vote
0answers
82 views

How to improve the coding quality in a problematic company [duplicate]

Due to circumstances I'm now working in a small software company. We make e-mail marketing management software and serve some big customers as our national railways and a big bank. The software has ...
3
votes
4answers
369 views

C# How to avoid memory leak in this case

I've got a Window, which gets a viewmodel instance injected into its constructor. The window sets its DataContext to that viewmodel. The viewmodel contains a command to "submit" the window ...
25
votes
5answers
4k views

Why use the discard variable in C#?

When coding resharper recommends that if you're to discard or ignore the return of a method, that you use this syntax: _ = TheMethodICouldCareLessAboutTheReturnValue(); I know you could just call it ...
-1
votes
1answer
92 views

Design Patterns for different statements [closed]

Background: To extract the data in statements from different banks and countries, each with multiple types of accounts. Use case maybe to analyze the spending patterns of individual or based on the ...
-1
votes
1answer
44 views

How can I pass a large amount of data from a JavaScript client to the web server in bulk

I have a Vue/Quasar application that allows the end user to convert an Excel Spreadsheet into an Array and load it into a DataGrid. The Spreadsheet has a list of peoples names, email address, ...
1
vote
1answer
94 views

Prevent users with multiple sessions using a single use voucher

I'm working on a .Net eCommerce site that allows users to use vouchers to get free products, discounts etc. The problem I have is that there have been instances of users, who have been issued single ...
1
vote
1answer
43 views

CQRS MediatR Create many items commad - is it a good practise?

I am here to ask question about: is it good practice to insert many records using CQRS and MediatR? how to structure that in terms of names and folders? A have to insert into database over 500 ...
-1
votes
3answers
200 views

Is it a bad idea to save the database in middleware?

So I've implemented the repository pattern in a lot of projects, but there seems to be a bit of a discussion on what is right with this pattern. Previously, I've always added Update or Create methods ...
0
votes
1answer
53 views

Extending TypeScript while being futureproof [closed]

C#10 Has extended the property pattern ability, I think it began since #7 EG: { Car: { Interior: pattern } } Meaning you can do some nice pattern matching even in if statements if (car_var is ...
0
votes
0answers
15 views

Scaling Docker Containers Question with .Net Core Worker Services

I have a fairly what I think is simple question but am completely unfamiliar with design considerations when using docker containers. So I have been trying to come up with a structure for an app that ...
-1
votes
1answer
34 views

Looking for way to store, get, partially update few relatively small JSON documents which has different unique types

I have an app with many individualistic features which behavior is controlled by settings. Let's say these are a few utility services with the following settings that are historically stored in ...
0
votes
1answer
79 views

Creating a contract for a UDP connection

I'm developing a system in C# who consists in a desktop application running a UDP server and a android app and this app sends data (byte array) to be read by the desktop application with commands and ...
-1
votes
1answer
150 views

Hardware test GUI with multiple event sources (4 serial ports and user interaction) - best architecture?

I have the following requirements: Write a GUI app for automated testing of some custom PCB hardware. The system must be usable for a technician with little to no advanced PC skills. The test setup ...
0
votes
1answer
85 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
0answers
77 views

Multi-threading optimization in-depth

A time ago I participated in an interview process where I was tasked with a simple requirement. I created the best solution I could, using some lock-free implementation. I didn't pass the code ...
0
votes
1answer
89 views

Are Flate compression in PDF and Deflate different algorithms?

I'm trying to make a program that produces pdf files. I've been studying the pdf format specification and specific pdf files whose format I'm trying to mimic. I found the line /FlateDecode in these ...
0
votes
2answers
242 views

Validations and throwing exceptions in DDD?

I have a question regarding validations and exceptions in DDD. I have a ValueObject say, PasswordText which takes a string argument in it's constructor. Checks if the string matches the password ...
0
votes
2answers
137 views

What's a good design of Football Live Scores website?

I am trying to create a web page with very fast real-time football match updates. The user gets today's matches (some of them Live) according to his/her timezone (the sets of matches are different for ...
0
votes
1answer
124 views

How do you identify unused parts of app and web .config files in .NET? [duplicate]

I am working on removing obsolete/unused pieces of configuration from a .NET product starting with appSettings. There are multiple solutions and I've noticed that appSettings can be in a .config file ...
0
votes
0answers
45 views

Moving from IUnityContainer to IServiceCollection and injection based on name

There are many RegisterType overloads with string for the name in Microsoft.Practices.Unity. Now we are moving toward Microsoft.Extensions.DependencyInjection.IServiceCollection. And there are no ...
1
vote
2answers
97 views

CQRS: Is it an antipattern if the Command invokes a database interface which contains business logic?

Martin Fowler states that, Command module executes validations and consequential logic which aligns with every CQRS demo app that I've studied. That is to say: validation -- does this Jedi exist? -- ...
-2
votes
1answer
464 views

why controller lifetime is transient by default in asp.net core? [closed]

I know the lifetime of the controller class is transient by default, but I think it's better to be singleton. should explain to me why creators choose transient instead of singleton or scope lifetime? ...
-2
votes
1answer
77 views

Why running migration turns into timeout in a production environment?

I know this is a theorical question since i don't have code to or any logs to show, but i hope that someone can give me some idea on this question. The problem in question was the following: On my ...
2
votes
1answer
144 views

Strategies to organize multiple projects which may reference each other and managed by different teams in Git?

First actually I don't think Git is a specific involved tool here, it can be any other Source/Version Control tool (TFS, SVN, ...). The point here is how to deal with the scenario in which I have ...
-3
votes
1answer
63 views

Inter application communication .Net

I have multiple WPF applications running different programs some of them are interconnected so one might have to start another at some stage. I need a way to communicate and share large amounts of ...
-1
votes
2answers
142 views

How to avoid CRUD and layered architectures in REST backends?

I'm creating a .Net 5 API backend and use EF Core for the database part. The simple CRUD way I know: API layer calling a command or query from the application layer using MediatR Application layer ...
-1
votes
1answer
49 views

Implementation of concurrent purchase for unique items

I am building an API for webshop. I need to implement following scenario: There are x (let's say 500) digital items, which will have same price (let's say each item costs 10$), but unique serial ...
1
vote
0answers
52 views

VM-images: how protect time-license programs?

One big customer asked me to supply my program to run within a balanced VM-images structure; I mean, the program will be recorded into an image which will be launched in "instances" to ...
0
votes
1answer
222 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 ...
0
votes
0answers
23 views

Should I create separate package to host web api as windows service in .net core 3.1?

Some background : I have common Web API library which adds Serilogger and Splunk integration/implementation for ILogger along with handling of common services/Middlewares such as Custom Authentication/...
-1
votes
1answer
82 views

Allowing end users to upload a large amount of data using Excel

I've read Allow users upload CSV files, and embed the data for a simple API , Importing large data sets into a database over the web the closest concept is Is there a way to efficiently allow a user ...
-1
votes
1answer
93 views

Version control organization for large .NET solutions

I'm trying to come up with a better way to organize my C# projects on SVN. The .NET solution for my main GUI has about 28 class library projects. These libraries fall into two categories. Some of them ...
0
votes
0answers
16 views

Binding checkboxlist on top of another model

I have a Customer and a Brand ViewModel public class CustomerViewModel { public int CustomerID {get;set;} public string Name {get;set;} public ICollection<Brand> Brands {get;set;} } ...
-2
votes
2answers
92 views

Ideas for implementing a hardware interface

I am looking for alternative ideas of how to implement the following situation (.NET Core, C#) Having multiple sensors that communicate over a RS485 interface with the host. Each sensor is implemented ...
1
vote
0answers
42 views

How to implement timing-mechanism for fantasy draft process utilizing ASP.NET Core 3.1 SignalR

I have developed a Fantasy Draft system utilizing ASP.NET Core SignalR, along with Azure's SignalR service (for backplane/scaling stuff). Last year I utilized a poor-mans' javascript version that just ...
1
vote
2answers
247 views

Why it is possible to specify a value comparer for ImmutableDictionary<TKey, TValue>?

What is the intended usage of the ImmutableDictionary<TKey,TValue>.ValueComparer property? Why is it useful being able to compare dictionary values by using a specified equality semantic? I ...
0
votes
1answer
256 views

DbContext lifetime in desktop app with SQLite

I am creating a small data-driven desktop application using .NET 5 with WPF, ReactiveUI, Dynamic Data, and EF Core 5. The app uses a local SQLite database to store all persisted state, and relies ...
1
vote
1answer
52 views

Custom File System Index/Cache - How to save index

I've got an extremely oniony(deep) folder structure which contains Appx 1,000,000 text-based files on a network share. Using windows search is extremely slow and unreliable. I've created some text ...
1
vote
1answer
159 views

Communication mechanism among windows or pages WPF

I work with C# and WPF and not using MVVM approach. One of the important part of applications is communication among Windows Pages and UserControls. In MVVM they do it behind the scenes and let you ...
1
vote
2answers
120 views

Prove that Feature Flags turned off Items in Production Environment

We want to implement Feature Deploy Flags, so Development Application Environment will have a new Product feature Toggled on. And Release and Production Environment Webpage, it is turned off. Its ...
2
votes
2answers
129 views

Is it right way to make Window to Singleton and call Visibility and Shutdown() methods directly in WPF?

There is a parent window that is the basis of the program, and there are several sub windows under it. Editor is one of the sub window and I'm making it. The code is as follows: // This is Code-Behind ...
0
votes
2answers
388 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 ...
-2
votes
2answers
174 views

How to Mock NamedPipeClientStream

I created a class called MpvController to handle communication protocols over a .NET NamedPipeClientStream. Now, I need to test this controller. I have a second class named MpvControllerFactory that ...
1
vote
1answer
223 views

Adding item (or incrementing count) to ListView, with the MVP pattern in WinForms

Description A WinForms application with the following as part of a form: When the "Add" button is clicked, a new entry is added to the ListView, with data from the TextBoxes and ...
-2
votes
1answer
111 views

How to do achieve parallelism in a console application

I have a .net web application, let's say A and a .net console application, let's say B.In A, I have a queue with multiple jobs to be done by B.Once I select the jobs from A, a queue gets created. Each ...
1
vote
2answers
457 views

C#: Use Double Await Cause Issues?

We have Application service Method, which extracts data from SQL database using Entity Framework Core . Its Async method along with the Async Controller. Service: public async Task<IEnumerable<...
7
votes
3answers
2k views

What are the benefits of multiple projects over namespaces in a solution?

I have been tasked to set up a guide for a microservice solution structure and find myself reflecting on why exactly I do things the way I do them. I am struggling to find an answer to the question ...
2
votes
3answers
251 views

Is this approach with JWT tokens wrong?

I have .NET Core WebApi application with JWT token for authorization. I also have roles and permissions. To make it more flexible for end user, I decided to make permissions like this: [Authorize(...
4
votes
3answers
3k views

How to mock a class not implementing an interface or having virtual methods

I'm trying to write unit tests for business logic classes I have control on, but which operates over some services that are not designed with the testability in mind. Currently I’ve extracted the ...
3
votes
3answers
490 views

Do I need to know about the history of the web and .NET?

As a .NET developer (for 5+ years) some times I think I should know all about the history of the dot net and also how the web was formed. However, I overlook the question by some justifications which ...

1
2 3 4 5
28