Stack Exchange Network

Stack Exchange network consists of 174 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 [c#]

C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform

3
votes
0answers
49 views

Using Active Directory ObjectSid as Primary Key in SQL Server for Data Access via ASP.NET MVC

I am designing an Intranet employee reward web app using ASP.NET MVC C#/MS SQL Server. This will only be accessed from within the network. Employees and managers will be able to give a reward to ...
3
votes
0answers
752 views

Unit Of Work with multiple database context

I have created an application (net core 2 & ef core) with Unit Of Work and Generic repository pattern. I used to have one database context but due to some business logic I had to create a second ...
3
votes
0answers
129 views

C#: simulate PostScript memory allocation

I'm working on a PostScript interpreter in C#. PostScript has memory management. It has virtual memory (VM). It also has objects. Two types of objects: simple and composite objects. Composite ...
3
votes
0answers
96 views

Dictionary-Sorting in bigger projects

My concern is how to handle ResourceDictionarys in a WPF (MVVM)-Project. I usually only create small Projects, so it doesn't matter that much, but since I created a Project-Template to handle some of ...
3
votes
0answers
2k views

Option<T> functional type implementation and scenarios

Have you ever being implementing Option<T> functional type? It is discussed here: https://app.pluralsight.com/library/courses/tactical-design-patterns-dot-net-control-flow/table-of-contents ...
3
votes
0answers
391 views

Separate settings and implementation class hierarchies

We use XML serialization to store class settings. Each setting-class has (but doesn't reference) corresponding implementation-class. Therefore we can easily make a "settings dll" without any ...
3
votes
0answers
2k views

Any “Gotchas” to using Entity Framework for Identity & Dapper for all other DB access in a .NET MVC application?

I'm firing up an MVC project in which I'd really like to use Dapper as my ORM, as I like to be as close to the database as possible for performance and SQL tweaking reasons, yet still have the power ...
3
votes
0answers
3k views

Should UserControl's be Views in an XAML MVVM application (WPF or Store app)?

I am about to use Caliburn.Micro for a new XAML Store app (not sure what to call it nowadays - does not appear to be called a "Windows Store app" any longer). The documentation (see Simple Navigation ...
2
votes
0answers
27 views

Is it safe to add extra role claims to the asp.net identity?

I am using the Azure AD authentication provider for the asp.net web application and I wish to add extra role claims (based on custom application logic, those cannot be provided from Azure AD). ...
2
votes
0answers
171 views

LSH for a wordlist

I am trying to write a spellchecker, I have a huge wordlist (at least 500K, because of the nature of the language). The performance would suffer a lot if I got the lavenshtein distance of all of the ...
2
votes
0answers
58 views

Propagating Data to multiple ViewModels - C#

I'm a bit new to MVVM, but here's my dilemma: I have a model (or models, but let's keep it simple) I want to show that model data on multiple different views. Ok, so ViewModel for each view gets ...
2
votes
0answers
52 views

Displaying entity framework calls in Sequence Diagram

I have a controller action which gets all the Plants by location from the database puts it inside a view model and passes it to the view. public ActionResult index() { List<Plant> plants = ...
2
votes
0answers
70 views

Is there a name for this Registry-Slot-Updaters pattern?

I noticed a pattern in my code. It applies to situations where things can be selected. It revolves around classes which I call (and in code often suffix with) Registry, Slot and Updater. Registry ...
2
votes
0answers
196 views

Replication between SQL server and Couchbase Lite

We have a main MS Sql server. This is the main data source that delivers and receives data to and from backend administration and (in development) mobile software. We need to make a connection to ...
2
votes
0answers
116 views

A / B testing without seperate deployments

I am part of a development team producing a project which requires many rounds of iterative development, each of which must be user tested, frequently in an A/B kind of environment. In our deployment ...
2
votes
0answers
158 views

Proper pattern to use when sharing large amounts of code and a similar control flow?

So I'm currently building an application that allows a user to fill out paperwork digitally, and then that information is taken in by the server and a PDF is populated and returned to the user. The ...
2
votes
0answers
379 views

Multiple Entity Business Logic/Changes, C# MVC Repository Pattern

I have a standard C# MVC project which has a domain layer using EF and repository pattern. Say I have a model like: public class MainModel { public int MainModelID {get; set;} //Many other ...
2
votes
0answers
517 views

Creating a generic Cache solution for function calls using SOLID principles in C#

I would like to have a caching solution for a variety of function calls. All of the function calls fit the following signature public ResponseType ProcessRequest(RequestType request); About half ...
2
votes
0answers
170 views

Data pipeline with fallbacks and callbacks

I'm refactoring our current design for how we download static data. It's a mess of deep class hierarchy and callback hell and I want to convert it to a more elegant straightforward design. Here are ...
2
votes
0answers
537 views

Correct Class Design for EAV Model

I need to design a class model to represent an EAV Model. I based my classes on this presentation http://www.slideshare.net/stepanyuk/implementation-of-eav-pattern-for-activerecord-models-13263311?...
2
votes
0answers
967 views

How to Use Python as a “Macro” runner for a C# Application

I am working on an application that the user may wish to automate some features of (but we don't know what at the moment) I would like to provide them some kind of scripting interface so they can play ...
2
votes
0answers
1k views

TryUpdateModel vs Parameter and ModelState.IsValid

As I was originally learning about MVC, the book I was using taught the following technique for Controller actions: public ActionResult MethodName(Model model) { if (ModelState.IsValid) { } ...
2
votes
0answers
299 views

Handling permissions in a MVP application

In a windows forms payroll application employing MVP pattern (for a small scale client) I'm planing user permission handling as follows (permission based) as basically its implementation should be ...
2
votes
0answers
1k views

Best Practice Method for Including Images in a DataGrid using MVVM

All, I have a WPF DataGrid. This DataGrid shows files ready for compilation and should also show the progress of my compiler as it compiles the files. The format of the DataGrid is Image|File Path |...
2
votes
0answers
757 views

An efficient way of starting an arbitrary number of consumer threads?

I have a Producer/Consumer implementation where the number of consumers is configurable (this is a form of configurable throttling). The producer and consumer are kicked off like this: var cts = new ...
2
votes
0answers
477 views

State Pattern Code for embedded device - Dependency Injection of Device Objects in Context and State Classes

I'm wrestling with some code and I think I've finally gotten some state pattern code working with my events. I've got a simplified system that will work like this: This is my first go with State ...
2
votes
0answers
145 views

Run a function when a function in a list is executed?

Goal: I'm currently doing an MVC project and I have this method to update the ViewBag (based on previous actions of the user). I would like to call this function whenever a certain list of MVC Actions ...
2
votes
0answers
333 views

Match buyers and sellers based on date ranges and quantity of shares

NOTE: This is in reference to the question I asked on Stack Overflow but was told to post this here I'm building a trading application that matches buyers/sellers that own subscription. Subscriptions ...
2
votes
0answers
653 views

SMTP traffic forward/relay?

We have three different networks. Regular, Trusted, Secure. Regular has access to the internet and trusted. Trusted has access to regular, internet and Secure. Secure has access to Trusted. We used ...
2
votes
0answers
742 views

ASP.NET Mvc3 - application/request lifetime and dependency injection

I thought of asking on SO, but it seems this is more of a "concept" type question than a "problem" type question. If it needs to be moved, please do so. Anyway, I'm having a tough time finding ...
1
vote
0answers
63 views

Name matching in SWIFT messages

Here i am basically looking for performance improvement. I need to match names in a SWIFT message (Let's say MT 103) against sanctions lists (sanctions lists by UN, by OFAC, some custom lists) and ...
1
vote
0answers
67 views

Hierarchy of models while designing a client for a RESTful service

I am trying to write a client for a restful service. I am confused in designing the models. Below are the details: I have a Model named UnicastMessageRequest, it's definition is like this: ...
1
vote
0answers
64 views

Is there a pattern/cleaner way of saving a large object with multiple nested classes?

I'm in the midst of a rather large project which involves decomposing a very old and large ColdFusion legacy application and creating some .NET services in it's place. Due to this, there are some ...
1
vote
0answers
66 views

How to design the Unity Container?

I have three projects: WebAPI, Services and Repository. WebAPI has a reference to Services and Services has reference to Repository. Now I need to add a Unity Container for Services and ...
1
vote
0answers
345 views

Where should I put my enums and interfaces?

I have an asp core MVC project for a college and I would like to implement a timetabling feature. To see if I could successfully even generate a dynamic HTML timetable, I started playing around in a ...
1
vote
0answers
59 views

Decoupling pdf rendering into a reusable assembly / using different rendering strategies

We have two apps: desktop client & mvc backend. Both apps have printing functionality. And it's quite obvious that we're repeating ourselves with that. Let me explain this. The routine looks as ...
1
vote
0answers
67 views

How to enforce separation of modules?

We're building an c#-dotnet-desktop application that's split into modules. Among other things, risk assessment leads to a classification into low, medium and high risk modules. The higher risk ones ...
1
vote
0answers
112 views

IoC - Should I use child containers to create scoped dependencies?

I have a number of command handlers defined for doing work against databases on various servers in our network. I am wondering if I should design each command to pass the following information in the ...
1
vote
0answers
53 views

Unit testing EventArgs - will there be timing issues?

I am writing a small game library. I capsule the logic in my model named Block. My model Block communicates only via events to it's clients (Is this a good thing to do!?). I wrote a simple unit test ...
1
vote
0answers
74 views

What is the best way to implement an HTTP endpoint with different return types?

I need to make an HTTP endpoint with different return types based on query params. There are several options to do that: Return an object with one property set and the rest equal to null: public ...
1
vote
0answers
44 views

Architecture for Product rate assigning to multiple store group. C#

I am writting a module where i am creating a rate for a list of product, and the rate for the product are assigned to different Store. The rate can be created in a group of Store, with Multiple Store,...
1
vote
0answers
970 views

Best practice for transaction handling using Entity Framework

I am developing an app which uses Entity Framework for data access. The architecture of the app somewhat like below: As depicted in the drawing, the business service can be consumed from either web ...
1
vote
0answers
310 views

Multi-Tenant & Multi-Object Permision Suggestions

I am looking for suggestions/examples on how to setup permissions for my project. I am using ASP.NET Core 2.0 with EF Identity 2 (on one server) and will be using IdentityServer4 (secondary server) as ...
1
vote
0answers
310 views

Moving Role CRUD operations from the Controller to the Application Service

I am creating an administration facility for an asp.net MVC application. I am currently trying to create a form that will allow admin users to create roles. I see plenty of code, which looks like ...
1
vote
0answers
162 views

inject repository into unit of work

Please see the code below: public IUnitOfWork<PersonEntities> Create(IRepository<PersonDTO> repository) { var context = new PersonEntities(); var ...
1
vote
0answers
494 views

Web API authentication Architecture 4 layers

Note: I am no architect nor security expert, I will try my best to explain. Currently I have been tasked to set up a new Web API2 asp.net, c#. The layer is as follows... Client >> New(public) Web ...
1
vote
0answers
176 views

Load balancing outgoing connections in Azure Service Fabric

I'm currently developing an app using the Azure Service Fabric. My question comes in regards to balancing outgoing connections. One of my services is going to be making a large number of outgoing ...
1
vote
0answers
32 views

DNN9 platform display issue

I just install DNN9 and try write module on it. I found a display issue. RESX:NVA_CONTENT.TEXT should be an icon. I also write a simple code on edit.ascx and when click edit module page will ...
1
vote
0answers
200 views

Getting a route from MethodInfo in ASP.NET Core

Is it possible that given a MethodInfo object, i can somehow figure out what the MVC registered route would be for that method? I've tried something along the lines of checking if the MethodInfo has ...
1
vote
0answers
202 views

Dynamic assembly loading vs multiple executables

I have ecommerce webapplication, that can connect to multiple storage systems. Currently I am using nuget to deploy it. I would like to split my application into parts (per storage system), because ...