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
2answers
68 views

How does one cycle back to previous options in a C# console application?

To say I'm fresh off the boat would be an understatement. I think this solution is extremely simple for an experienced programmer, but I'm completely new to C# and coding in general, so I apologize if ...
-2
votes
2answers
183 views

Loops to create nested loops [on hold]

Is there a way to use a loop to create more nested loops? E.g. Doing this for (int i = 0; i < iterations; i++) { //Do stuff for (int ii = 0; ii < ...
-5
votes
0answers
23 views

Image does not show while scanning document using C# WIA at Production [on hold]

I have develop application in C# using WIA, it works fine at development machine but at production it process the scanner but does not show image.
-1
votes
0answers
40 views

Question to better the understanding of how Async and Tasks<> work [on hold]

I wrote this program, it compiles and runs appropriately. However, There are a few things I would like clarified as I am still learning about Asynchronous Programming. Comments in the code on where I ...
2
votes
1answer
779 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
23 views

Class to manage EEProm Memory for microcontroller in .netMF

I've got a working driver to access the EEPROM chip, but looking for much better management and access of the memory. I've been racking my brain about what's the best or correct approach to do this. ...
-5
votes
0answers
25 views

About Files converted From OCR? [on hold]

Is there any software or process to find the OCRd files? If anyone have idea on this please reply asap.
1
vote
0answers
40 views

User and role modeling

I'm working with a system in ASP.NET MVC, with Entity Framework for ORM. The application has a requirements to allow users to have different types of roles, and authorization rules will be different ...
5
votes
0answers
204 views

Passing Anonymous Type to a Bound Control

Generally speaking, I'm fairly opposed to the use of anonymous types in real-world code (except in LINQ and some other specific scenarios), but I'm looking right now at a situation where I need to ...
1
vote
4answers
178 views

Tricky architecture in C# involving a symmetric operation and a viewing class

I'm trying to build an architecture in C#, and I can't figure out a way to accomplish the task. Basically, there's a set of classes A, B, C and D that inherit from I. Each of these classes has an ...
7
votes
3answers
149 views

Reducing boilerplate in class that implements interfaces through composition

I have a class: A that is a composite of a number of smaller classes, B, Cand D. B, C, and D implement interfaces IB, IC, and ID respectively. Since A supports all the functionality of B, C and D, A ...
4
votes
1answer
326 views

Pattern to use to relate multiple data sources to different user data widgets

I have an client x server intranet application the basically gets data from the server, format it and send that data to the client for display. At the server we are using ASP.NET C# running on IIS ...
3
votes
1answer
119 views

Design: .NET web app architecture problem

I'm taking my first foray into .NET and I'm designing a web app that's heavy on other web services right now. I'm intending to do the following: Take user input (a USDOT number) Request data from a ...
-5
votes
0answers
22 views

php vs c# application [on hold]

We are writing a point of sale application for a restaurant. We are debating whether to use a locally hosted PHP solution vs something in C# .NET etc. Our preference is PHP as we have more expertise ...
1
vote
3answers
409 views

Bad Practice using Auto Generated Classes for Data Access

I've seen this before but haven't found concrete reasons. When you add Entities to your EF model, EF auto generates classes for these entities. In terms of DataAccess, why is it preferred to not ...
0
votes
1answer
54 views

Is N-Tier worth it when developing an ASP.NET application?

Let me start of by saying that by "worth it" I don't mean "remove DI and interfaces" and such. What I mean is to place the code in separate class libraries. Like done in the Onion architecture - ...
6
votes
4answers
233 views

Testing a Conversion class

I have a class that is responsible for performing conversions from/to twenty-something types. Let's call this class ConvertUtils. For C# programmers out there - this class expands .Net's Convert ...
3
votes
1answer
244 views

Integration testing and database connection string in app.config

I am working on a project where SqlConnection is created via a static method, lets say it's DatabaseAccess.GetSqlConnection(). This method reads the .config file to get the connection string and ...
1
vote
2answers
290 views

Strategy for creating a websocket relay?

I own a Raspberry Pi and would like to use it as some sort of websocket relay, so that all people who visit a specific webpage would be able to communicate with each other. The key thing about this is ...
5
votes
2answers
329 views

Generic Sorting of Lists<>

I have several Lists<> that holds objects of different classes. List<classA> listA; List<classB> listB; List<classC> listC; //... List<classM> listM; The classes do not ...
1
vote
2answers
73 views

Inheriting and storing objects that contain different types of other objects

To start off, this is more of a best-practice question than anything. Introduction to the Environment I have myself an abstract class. Let's call this class Item. I also have another abstract class, ...
-2
votes
0answers
82 views

Disk faster than Memory? [migrated]

So I have a file called "Numbers.txt" having 10 million lines each containing one digit number. I want to sort this file and store the results in another file. So I wrote 2 really hacky solutions. One ...
1
vote
1answer
93 views

Design Pattern - Adding features to a class

I'm finding myself unable to solve a design problem. For the sake of my simplicity, I'm going to use C# (Web API). Let's say I have an abstract class RestController: public abstract class ...
0
votes
1answer
49 views

Class with navigation property and with or without foreign key

Let's say I have the following classes, auto generated by Entity Framework, that have an association: public class Parent() { public int ParentID { get; set; } // PK public int ChildID { ...
1
vote
0answers
46 views

Async library guidance

I'm creating a library that contains a class that exposes several Async methods: public class MyClass { public async Task<Foo> DoFooAsync() { /*...*/ } public async Task<Bar> ...
-1
votes
0answers
12 views

c# AXL/SOAP how to remove the extra blank line in the Datagridview from AXL input [migrated]

I have create a application that extract data from Cisco CUCM server. But I get extra lines in my output. I don't these extra lines. Can any one help me. Thanks //Send the xml soap to cucm ...
1
vote
2answers
97 views

Alternatives to using dictionary in parameters in C#?

I have a method that takes in a dictionary and enum value and produces a string output. Enum value defines what template string to insert the dictionary key value pairs into. public string ...
74
votes
7answers
100k views

Relationship between C#, .NET, ASP, ASP.NET etc

I'm really unclear on the difference between C#, C#.NET and the same for ASP and other '.NET' languages. From what I understand, .NET is a library/framework of... things. I think they're essentially ...
17
votes
5answers
2k views

Create new object or reset every property?

public class MyClass { public object Prop1 { get; set; } public object Prop2 { get; set; } public object Prop3 { get; set; } } Suppose I have an object myObject of ...
0
votes
1answer
79 views

Is having a Data Access Layer as singleton a good ideea

I'm working on a project(web application) where I have a DataManager(IDALContract dalImplementation) class that does some stuff with the data after retrieving it from the database or before saving it ...
0
votes
0answers
36 views

Decoupling related services

My project has a Product entity, and its stock is computed by its historic of sales(Order), loss, replacement... When a order is placed, the system should generate a stock line automatically. But I ...
0
votes
1answer
44 views

How can I check if answer the user typed in is unique in the form submission?

So, I have a form that has security questions and textfields for the user to type in their answer. I want to prevent the user from typing in the same answer to every security question selected. So I ...
2
votes
1answer
112 views

What does “Stateful” means in Stateful ViewModel in MVVM

I was reading about some XAML patterns, and there was the Stateful ViewModel, according to what I read it has nothing different than what we as just the "ViewModel". Here's a description for example ...
24
votes
4answers
11k views

When to use weak references in .Net?

I have not personally come across a situation where I've needed to use WeakReference type in .Net, but the popular belief seems to be that it should be used in caches. Dr Jon Harrop gave a very good ...
0
votes
1answer
300 views

C#/.NET multithreaded application design

The application to be designed serves as a bridge between two different systems. One natively speaks TCP (RS232 actually, but there's a COM->ETH server in the line of communication) - the other one is ...
5
votes
3answers
2k views

Best way to define, start and stop threads in C#

I am making a little program, which have few Threads, constantly running. At some point, I may want to stop one of them, and then, after random period of time, to start it again. So first, what is the ...
7
votes
2answers
779 views

Unit Testing with massive lookup tables?

Our system is structured in such a way that we get a lot of key info for our calculations and other such logic from lookup type tables. Examples would be all kinds of different rates (like interest ...
-2
votes
1answer
34 views

Security Issues to Enable Cross Domain AJAX calls [closed]

I am using ajax call from cross domain using dataType jsonp. I have added in web.config file <system.web> <webServices> <protocols> <add name="HttpGet"/> ...
4
votes
2answers
70 views

Returning a slimmed down domain entity from your view model

I'm wondering how to handle a ViewModel in the traditional sense, which includes both properties and methods, and another "view model" which is simply just the properties -- perhaps the ViewModel ...
1
vote
1answer
52 views

Repeating Interface inheritance declarations

Take the following example: public interface ISerialRVD { RouteValueDictionary ToRVD(); } public interface IViewModel : ISerialRVD // Here? { Int32 Page { get; set; } String Action { ...
-2
votes
0answers
12 views

c# XML Data to Datagridview [migrated]

I have a application that extract data from Cisco CUCM with AXL to Datagridview. I Get the data into DataGridView but lats of spaces in between and I want to get rid of it. AXL Data is: ...
1
vote
2answers
53 views

Abstracton layer to control services access to denormalized db entity

Our db is optimized for minimum join count (partially denormalized). E.g. our User entity contains account data (nickname, facebook id, etc), user numerical statistics (total games played, total wins, ...
12
votes
6answers
9k 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 ...
3
votes
0answers
90 views

Token or ASP.NET Identity based security in ASP.NET Web API 2

Background I have a Web API 2 project, without any extension of ASP.NET MVC or ASP.NET projects. The API will only be used to communicate between the server and Windows 8, Windows Phone 8.1 and iOS ...
1
vote
1answer
106 views

Managing Massive Updates with Resource Access

I have a number of data servers that are pushing data to a main server as in this kind of architecture: These data points (points for short) are updated randomly from each server. On the server, ...
-2
votes
0answers
179 views

If C# properties are just syntactic sugar for methods, why is it so hard for the C# team to add extension properties?

Extension methods already exist... surely extension properties would be simple wrappers for extension methods? Someone explain this to me; I'm genuinely curious...
4
votes
2answers
77 views

Strategies to analyze collected exceptions

We want to add error feedback to our application. I had a look at existing solutions (e.g. raygun.io), but these work "in the cloud", which is a no-go for us: most installations of our application ...
1
vote
1answer
727 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
1answer
356 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
601 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 ...