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

1
vote
0answers
42 views

Where to store configurable, global settings

As an example, let us say that I have an application with multiple users and multiple administrators. I want the administrators to be able to configure sitewide session timeouts. The code would ...
-2
votes
0answers
33 views

Does the user need to install CS script himself if i use it in my C# program?

The current program i am making has come to the point where i need to include some kind of scripting. Looking at the avaliable stuff CS script seemed the best solution for my problem. Now the problem ...
2
votes
1answer
95 views

Call method in a disposable object at the beginning of a “using” statement

When we use the lock statement, it is essentially doing a Monitor.Enter at the beginning of the locking block and a Monitor.Exit at the end of the block. This process is automatically handled by the ...
-4
votes
0answers
23 views

C# console app which calculate a volume of a box [on hold]

I'm new in C# and I'm trying to make a program which calculate the volume in decimals of a box. I made something but is not working. I would like to know what is wrong and see a solution. I need to ...
7
votes
4answers
818 views

Unit testing and Test Driven Development questions

I'm working on an ASP.NET MVC website which performs relatively complex calculations as one of its functions. This functionality was developed some time ago (before I started working on the ...
1
vote
3answers
154 views

Using prefix/postfix increment operator for simple incremental array access rather than actual index numbers

I cannot decide which method is better with consideration of both readability and fault-tolerance. Method #1: Object[] objects = getArrayOfKnownLength(); int i = -1; someMethod(objects[++i], ...
1
vote
2answers
54 views

DLL or web service for common functions?

We have a variety of basic functions (date utilities, email sending, internal math calculations, etc) that are currently in an old VB.NET project. We're going to move towards C# and I'm wondering if ...
4
votes
2answers
158 views

C# obtain derived class from base

I am trying to build a dashboard that allows a variety of widgets to be displayed on the home screen. They are structured as follows: public abstract class Widget {} public abstract class ...
1
vote
1answer
699 views

Data transfer between “main” site and secured virtual subsite

I am currently working on a C# ASP.Net 3.5 website I wrote some years ago which consists of a "main" public site, and a sub-site which is our customer management application, using forms-based ...
2
votes
2answers
172 views

How to iterate between these elements

I have an array of elements: int[] elem = new int[] {A, B, C}; I need to calculate the sum of ALL the combinations of those elements, where only some of the elements can be optionally selected. I ...
1
vote
1answer
301 views

What is better repository design?

I have tables that I insert, delete and update, but I read from views. At times, I may read from the tables as well. What is a better generic interface for a Repository: public interface ...
0
votes
3answers
538 views

Manage ClickOnce releases for different parties

I'm struggling with release management of a piece of software. First some general information: It is a ClickOnce application I follow the release often practice There are about 30 parties served ...
-3
votes
1answer
113 views

ASP.net/IIS runtime environment [closed]

I'm not too experienced in the regard of configuring IIS/ASP.net. A client has asked me to extend the functionality of a custom web application I didn't develop. Unfortunately, they don't have the ...
8
votes
5answers
9k views

Should I use abstract or virtual methods?

If we assume that it is not desirable for the base class to be a pure interface class, and using the 2 examples from below, which is a better approach, using the abstract or virtual method class ...
6
votes
1answer
1k views

C# open-source framework for multithreaded task management

I have an API library for C# that provides flexible multithreaded task management of objects on task bases. The library was developed extensively for a project that was later cancelled by the client. ...
0
votes
0answers
30 views

Class design for an app that reads data from Active Directory

I am hoping someone can help me regarding design and architecture for an application. The application is basically a service written in C#. The purpose of this service is mainly to read data from ...
7
votes
2answers
318 views

Big O equivalence for LINQ select

I'm trying to determine if there is a change in the Big O equivalence of a nested loop when I use a LINQ select instead. public void myFunc(List<Foo> fooList, List<Bar> barList) { ...
1
vote
2answers
289 views

.NET Why should I use DAL over direct database access

Yesterday on one of SO chats I've been told I should never connect to database directly from the application and rather use DAL. I've been told that: 1. Using something in the middle should improve ...
2
votes
3answers
160 views

Accessing shared data without blocking in TPL

I am writing a class that contains data. It exposes methods that allow to query the data, while the data is also being updated from an external source (web service, for example). All the methods ...
5
votes
3answers
208 views

When should I use C#'s implicit type conversion operator?

In C#, we can overload the implicit conversion operator like this (example from MSDN): struct Digit { /* ... */ public static implicit operator byte(Digit d) // implicit digit to byte ...
-3
votes
0answers
21 views

Microsoft.Reporting.WinForms VS2013 Missing [closed]

I've found several answers to this - Most involve running the REPORT VIEWER 2012 RUNTIME from https://www.microsoft.com/en-us/download/confirmation.aspx?id=35747 Been there done that. Doesn't show ...
0
votes
1answer
275 views

Organizing Business and Presentation entities

Background I am developing a WPF project. This is the basic structure: User Interface (WPF Project); Interfaces (class library, contains all the interfaces and the entities used by the ...
0
votes
1answer
126 views

WPF and data in the cloud

I need to create a WPF app that users will use on one machine and the manager wishes to use at home in the evenings. I have already suggested a web app which they don't want to do so suggested hosting ...
0
votes
0answers
36 views

Pushing data into chunks from server to mobile client

I am developing a windows phone application. On the first screen user enters some unique code and based on that code there are say 200 or more records on the server which I want to return to the ...
-2
votes
0answers
113 views

How do people get into .NET development? [closed]

I ask if anyone knows of any research into how .NET developers (c# or VB.NET) got into .NET (opposed to Java, iOS, etc). I have a couple of theories but I'd like to be a little more solid on the ...
-1
votes
0answers
35 views

Tcp server language choice [closed]

Is there any reason to use a specific programming language for TCP server programming? Or java, c# can achieve same as c++ without any noticeable performance loss?
15
votes
7answers
1k views

What's the idea behind naming classes with “Info” suffix, for example: “SomeClass” and “SomeClassInfo”?

I'm working in a project which deals with physical devices, and I've been confused as how to properly name some classes in this project. Considering the actual devices (sensors and receivers) are one ...
11
votes
6answers
8k views

Understanding the static keyword

I have some experience in developing with Java, Javascript and PHP. I am reading Microsoft Visual C# 2010 Step by Step which I feel it is a very good book on introducing you to the C# language. I ...
0
votes
1answer
67 views

Why is it faster to compact a portion of the managed heap than the entire heap?

I was reading this article on MSDN. In the first paragraph under the "Generations and Performance" subheading is written: First, it is faster to compact the memory for a portion of the managed ...
2
votes
1answer
110 views

How do you handle saving blog tags in MVC?

I'm writing my own blog engine as a learning exercise. The blog is fairly functional right now but I'm trying to add a 'tag' feature to it and I'm confused as to what the best way to handle saving a ...
3
votes
3answers
1k views

Why shouldn't an object reference have access to a static member in C#

Context of my question: I am reading C#. Trying to understand Static keyword. I understand that when Static is applied to a member of a class, it can only be modified by the class and not the class ...
1
vote
1answer
127 views

Should I use: One event multiple subscribers or multiple events multiple subscribers

I am writing a data acquisition application. I wondering whether I should use one event multiple subscribers or multiple events multiple subscribers. I am worried about performance. Also could I ...
11
votes
3answers
11k views

Entity Framework and layer separation

I'm trying to work a bit with Entity Framework and I got a question regarding the separation of layers. I usually use the UI -> BLL -> DAL approach and I'm wondering how to use EF here. My DAL would ...
0
votes
1answer
82 views

How can I avoid an SDK requirement for an end-user unless he uses a specific function?

One of the modes of my program uses Microsoft Kinect but the user may never decide use that mode. I want to make it so the libraries for that functionality are only looked for and loaded if he uses ...
0
votes
1answer
151 views

How can I decouple query and context in a “query object” scenario?

I'm using a query object pattern (similar to this) to manage disparate queries while avoiding bloaded facades/repositories. A query object takes a number of constructor parameters, representing query ...
0
votes
3answers
232 views

What arguments are there to use a coding style for each distinct language? [duplicate]

I recently had a discussion about our coding style for C# projects. Two things in particular were very hard to agree upon. Method Naming C# has the de-facto standard of naming (at least public, ...
2
votes
2answers
250 views

Refactoring long methods with a lot of cyclomatic complexity

I'm attempting to refactor what is becoming a very large method -- currently 350 or so lines -- that contains a high degree of cyclomatic complexity. I understand and ascribe to the theories that ...
3
votes
1answer
257 views

Correct placement of Methods in OOP

Which Class should contain a method which has dependencies on multiple classes? I've coded up a specific example to avoid generalizations. In this example we have an initial requirement : ...
3
votes
1answer
201 views

How can I use the “Non-Member Functions Improve Encapsulation” pattern from C#?

In 2000, Scott Meyers argued that non-member functions improve encapsulation. In C++, a non-member function is a C-style global function: ...
6
votes
3answers
262 views

How to explain design decisions when refactoring code

I am working on a colleague to refactor the following code, I am trying to turn this into a teaching experience as well. Original Code public class WidgetRepository { public Widget ...
2
votes
4answers
170 views

Failover for High Frequency Jobs

I have a job that runs at a fairly high frequency (~1x every second). This job needs to be executed constantly as long as the web app is running. However, I really only want 1 instance of the job ...
2
votes
2answers
68 views

Share some fields but others unique to owner of instance

I've been programming for many years and this is sort of a strange need and I've never seen anything like this but I have a game where there are abilities that you can do. There is an ability class ...
1
vote
4answers
255 views

Why I need to make method of my class private, If I need to access it throughout my application?

I am going through the beginners tutorial for C# from a website http://www.homeandlearn.co.uk/csharp/csharp_s10p1.html On chapter of classes, it makes the method of class private and then use ...
7
votes
3answers
9k views

What is meant by Scope of a variable?

I think of the scope of a variable as - "The scope of a particular variable is the range within a program's source code in which that variable is recognized by the compiler". That statement is ...
2
votes
1answer
182 views

How to backup data and images in this project?

I have MS C# and MS SQL 2008 database project. It can capture employees' records with pictures of more than 1000 records. Presently, I'm able to capture say 150 records on PC1 using my installed C# ...
1
vote
2answers
86 views

DDD using an ORM and a Active Directory Server for Persistence

With Domain Driven Design one would model out the domain. One would then use an ORM of some sort to take care of the persistence. Say you have a Product entity which has a Name, SKU and an Owner. This ...
1
vote
3answers
163 views

c# application to read xml files, parsing them, storing locally in data structure and writing to csv

I have to develop a c# application that will read large xml files. XML files will have data about computer systems (i.e. Hardware, software, network, bios information). There will be separate xml file ...
-2
votes
0answers
59 views

OOP vs ADM Comparisom

This is the ADM equivilant to the example code given in Correct placement of Methods in OOP In this example we have resolved the Method placement question by moving ALL methods away from the data, ...
0
votes
1answer
57 views

c# class generation/architecture for json rest service

I want to consume part of the Steam WebAPI, it's a simple Rest Service but it produces some complex json. I thought about using the Newtonsoft Json.Net Library generate my c# objects. Whats the best ...
0
votes
2answers
396 views

How are the tiles in WORDAMENT organized?

I'm trying to create a word game, just like WORDAMENT, in my spare time. In order to present a new round, I need to create a board with 16 letters organized in a 4*4 grid. Currently, I'm generating ...