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
1answer
7 views

Implementing a series of independent Actions that are disparate but with common accessibility

I have a requirement to implement a type of AI for a project, the issue is that I am having trouble visualizing how the AI should actually be implemented. Essentially, I want the AI to be as dynamic ...
4
votes
2answers
85 views

Should serialization and deserialization be the responsibility of the class being serialized?

I'm currently in the (re)design phase of several model classes of a C# .NET application. (Model as in M of MVC). The model classes already have plenty of well-designed data, behaviors, and ...
0
votes
1answer
31 views

Step-by-step functional testing automation

I have a basic class in C# from which I create inherited classes for databinding scenarios. You can think of it as a substitute for .NET's DataRow class. I want to automate testing of a typical row's ...
1
vote
3answers
62 views

Using delegates to avoid duplicate creation of resources

I'm writing a PCL that uses an HttpClient to go visit a few sites and extract data from them. My initial code looked like this: public static class Download { public async static ...
1
vote
1answer
115 views

C# intentionally flickering

i'm currently working on a project which must provide intentionally flickering of some part of UI (white rectangle which must change color to black). That changing of color must be done at some ...
0
votes
0answers
20 views

Using REST to get/post/etc polymorphic types stored in Table-per-Type database

I've got a Table-per-Type database something similar to this: public abstract class WorkItem { public int WorkItemId {get;set;} } public sealed class CancelingWorkItem : WorkItem { public ...
-1
votes
0answers
30 views

Active Directory Users + CRUD operations + Web Application + c#

I would like to make web application that is available only for domain users inside my company. What I need for now is to create a page that allow CRUD operations on AD users - It could be a ...
-3
votes
0answers
15 views

ASP.NET MVC Display dbo.webpage_Membership table

Im using the already built Account model in MVC 4 and Im trying to display dbo.webpage_Membership table on my page. I managed to do that with UserProfile class and display UserId and UserName. ...
-3
votes
0answers
35 views

How to programmatically (C#) add/modify firewall rule on windows 7 and newer [on hold]

I am writing application, where is need add rule to windows firewall when application start and remove/disable when is closing. How make it in C#? Thanks for reply.
3
votes
1answer
72 views

Creating an interface just to decouple from third party libraries

I'm currently developing the Authorization module on a framework of mine. I have the following class so far: public interface IAuthorizationManager<C> where C : ...
-6
votes
0answers
33 views

Make a gui for the windows command line function junction point [on hold]

I want to make a GUI for command line function junction point basically for this command mklink /j D:\Docs E:\Users\Kari\Documents SO instead of going to command line and typing the DIR's the ...
0
votes
0answers
62 views

Using static Create() methods with delegates in abstract base classes in C#

I am attempting to write an extensible graphing calculator program, in which individual components can be extended or replaced as needed without changing other components. I create a DLL containing ...
0
votes
1answer
20 views

How to trace an image/char on mobile device using c# and/or xamarin [on hold]

If I had an image outline (or font character outline), how would I go about calculating the accuracy of somebody tracing that image. I was thinking that I could get the RGB components of the person's ...
2
votes
0answers
139 views

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

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 ...
-5
votes
0answers
32 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
45 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 ...
0
votes
0answers
27 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. ...
1
vote
1answer
63 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 ...
1
vote
5answers
239 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 ...
0
votes
2answers
307 views

Loops to create nested loops

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 < ...
9
votes
4answers
299 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 ...
-5
votes
0answers
31 views

php vs c# application [closed]

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 ...
3
votes
1answer
130 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 ...
0
votes
1answer
69 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 - ...
-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
2answers
78 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, ...
5
votes
2answers
347 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
1answer
112 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 ...
-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
101 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 ...
0
votes
0answers
38 views

Decoupling related services [on hold]

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 ...
1
vote
0answers
58 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> ...
0
votes
1answer
85 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
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 ...
18
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 ...
4
votes
2answers
72 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
53 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 { ...
8
votes
2answers
824 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 ...
0
votes
1answer
53 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 { ...
-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: ...
7
votes
4answers
255 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
0answers
102 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 ...
-2
votes
0answers
185 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...
1
vote
2answers
58 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, ...
2
votes
1answer
102 views

Beginners C# question about Array.Reverse

I am sitting through a very well-explained and thorough video tutorial series, using Visual Studio 2012 as my developing environment. Anyway, one thing that is hard to figure out is this. Say you ...
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 ...
2
votes
1answer
57 views

Access modifier of abstract class constructors

What access modifier should I use for my constructors in an abstract class, given that the class cannot be instantiated? It seems like the access modifier is superfluous and should be implicitly ...
1
vote
0answers
94 views

Why are Nuget packages so big? [migrated]

I recently added MathNet.Numerics through NuGet to my C# solution. The package directory in the solution folder ballooned to about 50 MB! Yet I can simply download the MathNet dll and use only that, ...
1
vote
1answer
82 views

Correct approach for creating api contract

I need help regarding below: I am trying to design an API. For creating contracts below are the two approaches: Approach 1: public class MyController { public void MyAction1(Dictionary<string, ...
2
votes
2answers
39 views

WCF service with methods to fetch data

I'm planning on building a WCF service that will fetch data entities from a Sql Server database. And I'm currently struggling with best practices issues. The thing is that there's a few different ...