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

learn more… | top users | synonyms

0
votes
1answer
221 views

C# Design Patterns

I have a question about what the best design pattern to use would be. I have 2 specific scenarios, the first one fits neatly into a Unit of Work(UoW) pattern. The second is a little bit more fiddly. ...
6
votes
1answer
596 views

Workflow Foundation to separate data from business logic on a mid-sized App?

We are currently developing a .net app in WPF, that will be a desktop app with a good bit of data-access to local (and some remote) servers. The business logic here is very complex, and currently it ...
0
votes
0answers
13 views

Azure Service Fabric and TCPListeners

I have a task to set up two TCP Listeners on different IP's (which will need to be static. The project manager has asked me to look into Azure Service Fabric to ensure high availability. The listeners ...
2
votes
5answers
198 views

Unit Test for Void which copies data from one location to another

Still learning and getting my head around Unit Testing, (also trying to get into TDD, though I appreciate it isn't the same thing) and in many ways it is changing/improving my code. But I come across ...
1
vote
3answers
921 views

How should I handle multi-tasking in a WPF application?

In most of the multi-tasking CRM applications I've seen, MdiWindow is used to allow users to open multiple windows at the same time. But MdiWindow doesn't seem to be commonly used in WPF. Looking ...
1
vote
3answers
293 views

Put code on client (JS) or server (C#)

In an ASP.NET app, I've got to decide whether to put a complex piece of code on either the client in JS or on the server in C#. I've considered performance (if on server, it would be a small ...
1
vote
1answer
185 views

What is the correct reusable architecture using Entity Framework for common database tables and services?

Context I have a line of business application "MyApp" in C# using EF. Layers are separated as MyResusableLib.DataAccess // Class Lib: EF based utils, extension methods, MyApp.DataAccess // Class ...
1
vote
0answers
30 views

Selenium Test Design Struture - Test Granularity for a Large Project

Summary I have large Selenium Test project, and I'm struggling with how to manage my test structure in a way that I feel is easily maintainable, scalable, and that provides a good level of test ...
0
votes
2answers
3k views

Should I use a separate class per test?

Taking the following simple method, how would you suggest I write a unit test for it (I am using MSTest however concepts are similar in other tools). public void MyMethod(MyObject myObj, bool ...
1
vote
1answer
68 views

Loading data from JSON file for one time

I have JSON file which has some hundereds of rows stored like below.. [ { "Id": "1", "Name": "A" }, { "Id": "1", "Name": "A" } ] I am trying to load this into collection of ...
1
vote
0answers
23 views

Adding custom object-string transformers to a global static list field in my logging library. Is there a better way?

I'm writing a central logging library. In it is an AutoLogAttribute method attribute that automatically logs entry/exit of methods and their parameters (automatically serialized) like this: [AutoLog] ...
-2
votes
1answer
82 views

Why C# ASP.NET MVC Code First POCO Classes must have getters and setters?

Why in, C# ASP.NET MVC Code First project, POCO Classes must have getters and setters ( {get; set; } ) in order to work? public float data { get; set; } or in db context class public DbSet<SGD....
4
votes
3answers
3k views

Separation of retrieving data and business objects between DAL and BLL Layers

I did some research before posting this question. Among other questions or post, one of those is provided below. I could not get a clear mind how to determine.. Business Objects within a Data Access ...
0
votes
0answers
24 views

Using list of actions in language implementation

I'm implementing a small programming language as a hobbyist. My first idea was to compile the language to some kind of a intermediate language and then interpret it. However wouldn't it be a good ...
4
votes
2answers
146 views

Is it okay to use static classes while creating a wrapper for REST API?

I am consuming a web service in C# using REST APIs. So, I have created a wrapper classes for each endpoint. It seems like a good idea to implement the wrapper using statics. This makes code look much ...
0
votes
1answer
86 views

Row level security with multiple rules

I need some assistance with designing a system which implements row-level security that could have multiple conditions that need to be satisfied. Context Suppose I have a user. A user can belong to ...
1
vote
1answer
68 views

How can I filter my coordinates system?

Following up with this, I have a bunch of coordinates and I draw them on a bitmap image as a coordinate system. Now, I would like to get rid of all the noise, and filter coordinates to give a "clearer"...
0
votes
1answer
55 views

General guidelines for architecturing a plugin based application

Our application is composed of a main webapp and a handful of windows services that perform a variety of jobs that feed, sanitize and optimize that webapp. In order to ease the task of maintaining ...
0
votes
0answers
16 views

Developing Python Scripting API using Petrel Ocean SDK (C#/.NET)

I use a commercial software called Petrel. Petrel has a software development kit (SDK) that allows the user to develop plugins in C#/.NET via the Ocean core API. At our offices, we have installed a ...
3
votes
2answers
99 views

Get a list of user currently using an application

What I need to do : I've been asked to add a feature to one of our application that would allow a supervisor to send a message to all or one of the users currently using the application. The ...
1
vote
0answers
51 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
59 views

C# and .Net Core Multi Projects Architectures Solutions [closed]

I starting a new set of projects in C# and .net core initially in WPF or UWP (windows desktop app) with a goal to theirs to all mobiles (ios, android and wp), asp.net core, MacOS and Linux. What's ...
15
votes
4answers
2k views

How should I store readonly data to deploy with my application?

I'm developing a desktop application, and this application requires some information to run, but it doesn't change any of this information (the data must be loaded on every execution of the app, but ...
1
vote
1answer
73 views

XElement.Parse and querying versus serialization (strongly typed objects)

We have a rather large code base that interacts with many SOAP based XML services. Each one of these services makes 1 to n service calls A typical low level web service call looks like this (...
-1
votes
0answers
133 views

Is it possible to turn an entire project to a single class file? [closed]

I'm using Visual Studio 2013 Ultimate and I need to know if it is possible to turn an entire project (including settings, all classes, references...) to a single class (.cs file). you may be wondering ...
0
votes
0answers
128 views

What is the meaning of the different interface types in Ian Sommervilles's Software Engineering?

Reading Ian Sommervilles's Software engineering, he mentiones there are following interfaces: Paramater interface: data or functions are passed from one component to another Shared memory interface: ...
1
vote
1answer
61 views

How to create a layout of controls that can be duplicated on a form at runtime

I have a bunch of controls including labels, updown menu, combo boxes, radio buttons, and check boxes that must be replicated once someone hits the add button. Is there a way that I can create a ...
1
vote
0answers
66 views

Given a two-dimensional array what is there a good way to identify distinct regions of elements?

I am generating a 2D "world map" in Unity which I use C# and Perlin noise for. I have a Tile object that holds the graphic of the tile and position. There are a few more attributes to this class, ...
-1
votes
1answer
172 views

What's the best way to populate a new row in a database?

Is it possible to add a new row to a database using DataSet? When I created a new DataSet and dragged the table from the database I could see that in the DataSet methods there was one called insert ...
6
votes
2answers
392 views

When is it appropriate to use expression bodied members? [closed]

C# 6 introduces expression-bodied members, which allow for simplified code in methods and properties that only return the result of an expression: public override string ToString() { return ...
0
votes
3answers
97 views

Compiling methods in interpreted programming language as standalone c++ app

I'm writing an interpreted implementation of a new programming language (just for fun). In this implementation language is first being compiled to an intermediate language, which is then interpreted ...
4
votes
6answers
10k views

Better way of storing key-value pairs in the database?

I have a C#/SQL Server program that sometimes needs to store data. The data could be a response from a web service, a result of a database query, or any number of other things. There's no way of ...
3
votes
3answers
410 views

In critical code, should exceptions describing a nonsense condition be handled?

Let us consider the following C# code as an example: public static string GetCurentExecutableDirectory() { return System.IO.Path.GetFullPath( System.Reflection.Assembly....
-2
votes
3answers
70 views

Most appropriate function naming for WPF's INotifyPropertyChanged implementation [closed]

Each time I was involved into a different WPF project over different companies, the INotifyPropertyChanged function implementations were named quite differently, either public void ...
0
votes
0answers
74 views

How to detect global keyboard hook

It's incredibly easy to write Key-loggers in many languages. It makes me a little nervous because these small, unknown viruses won't get detected by most(read: all) antivirus'. I'm curious how to ...
0
votes
0answers
37 views

Using an online database for multiple users to store their data

I am considering changing my wpf application to use a online database instead of a local XML file. I have read some tutorials about binding data grids to Mysql database tables. But what I don't ...
1
vote
3answers
189 views

Should I create .Clone() on a class or create a copy-constructor?

I'm quite unsure what I should use in C# - both should in theory do the same, but I think both are quite easely overseen. Or is there another possibility I have to take in consideration? I know in C++...
1
vote
1answer
138 views

Inheritance is better or composition design pattern in this scenario?

Design and implement Cash Register: Given a number of items you will be required to calculate the total bill. Items are charged for in a couple of different ways: A given price for each item, e.g. ...
2
votes
5answers
138 views

Database transaction and separation of concerns

Apllication structure: Business layer public interface IOrderDataService { void Save(Order order); } public interface IOrderLineDataService { void Save(OrderLine orderLine); } public ...
0
votes
2answers
138 views

Is interface containing every method of given class a good thing?

I'm trying to write a simple game and I really want to finally create something that would be "programmatically correct". I stuck with a problem like this: I have class public abstract class ...
-1
votes
0answers
74 views

Web app(MVC 5),web api 2, native Android and iOS to use one mode of authentication?

I need to develop an application in MVC 5, Xamarin Android and iOS application; as these applications have the same features, i have Web API 2 for all common operations except one! Authentication! I ...
3
votes
2answers
646 views

Best way to store motion changes to reduce memory

I am comparing jpeg to jpeg in a constant 'video-stream'. I am using EMGU/OpenCV to compare each pixels at the byte level. There are 3 channels to each image (RGB). I have heard that it is common ...
0
votes
0answers
62 views

Generating reports from large datasets

I'm working on an CRM type application(.NET, SQL Server) that needs to generate reports from large datasets, millions of database rows in a dozen different tables with a lot of aggregation and logic. ...
-4
votes
1answer
81 views

User Interface and code. How they communicate? Is it just an image and nothing to do with program code [closed]

Does UI interface is just an Image created by graphics tools?. I need to know that when a user interface created to read an textbox in c#. When a text entered is it take values from keyboard by ...
0
votes
4answers
332 views

Machine learning without programming?

I am old to programming and very beginner to Machine Learning and what make me surprise is the defination as i typed in google i found this. Machine learning is a type of artificial intelligence (...
2
votes
3answers
266 views

Pattern to use (if any) to co-ordinate loosely coupled classes with strong interdependencies

I have a collection of cooperative classes whose behaviors are interdependent upon one another. But I wish to keep them loosely coupled, so I've created appropriate interfaces. I want to determine an ...
2
votes
1answer
265 views

Modular Filter Architecture for WPF

I am creating a little stock-management tool for private use. I have different views, which need similar but different filters. As an example I have a "current stock" list where I can filter for ...
0
votes
4answers
183 views

How do I elegantly store tabular data in code?

Let's say I want to store date which cannot be changed by the user in code. For example, my application supports ten types of reports, and I want to store metadata about it. Usually, I'd use a ...
0
votes
1answer
113 views

Alternative to ObservableCollection in c# wpf MVVM

I am new to wpf c# and MVVM approach. I have a working program that demonstrate the MVVM approach in wpf c# (by copying some code from the internet and applying it to may program). I have used ...
2
votes
2answers
733 views

What does the implementation of .NET string.Split(char[], StringSplitOptions) look like from inside?

That is if we were to see how Microsoft wrote this method what would it look like? I'm mainly interested in the use of the StringSplitOptions enumeration with the other parameter and how they probably ...