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

How to unit test static void methods?

How does one go about unit testing static void methods? I have a few more questions: Is it necessary to unit test database queries like insert, select and update queries ? If so, how does one test ...
0
votes
1answer
51 views

A CLR SQL Server Stored Procedure calling an ASP.NET Web API

We are developing a big system with SQL Server database, ASP.NET Web API 2.2 services and another external services. We need to load more data on a table while we process the current data on it. To ...
-1
votes
0answers
18 views

Designing a windows application to maintain states across MDI child forms

It's a pretty long post and I shall try my best to explain the working of the application that I have developed and want your assistance in extending it for the future. I need to design a windows ...
3
votes
1answer
104 views

Legitimate cases of having .equals() behaving inconsistently with .compareTo()?

Java documentation says it's "strongly recommended" to have them behaving consistently. But are there legitimate cases of java/c#/python/etc Object.equals() method behaving inconsistently with the ...
-5
votes
0answers
37 views

c# cannot insert data into database [on hold]

I tired to my code, i have no idea whats wrong with my code please help me to fix this This code should be insert the data into database, here im using ms access this is my file staff.cs using ...
2
votes
0answers
28 views

Application plugin system - interfaces - adding new features

Imagine I have an application, which have plugin system. public class MyPlugin : Plugin { public override ExecuteImpl (Context ctx) { // do something... } ...
1
vote
2answers
154 views

When it makes sense to implement C# explicit operator?

Follow-up of Is my usage of explicit casting operator reasonable or a bad hack? One of the users commenting on that question said that it's really bad if the casting operator creates a new object ...
-4
votes
0answers
32 views

Need assistance desigining Algorithm Array in c#? [on hold]

In 2 dimensional array Suppose elements before: 1 2 3 4 5 6 7. 8 9 10 11 12 And after applying the code array should print 1 2 3 4 10 11 12 5 ...
22
votes
5answers
3k views

Is my usage of explicit casting operator reasonable or a bad hack?

I have a big object: class BigObject{ public int Id {get;set;} public string FieldA {get;set;} // ... public string FieldZ {get;set;} } and a specialized, DTO-like object: class ...
-5
votes
0answers
51 views

Can you please tell me ideas of a website or an app that you want to be invented? [on hold]

I am a programmer and I want to create a big project. I can code websites, desktop apps, and android. I just have no idea what I should program. Is there any thing that you want a website or app to ...
-2
votes
0answers
39 views

Quickest way to build reusable data access code during 5 hours exam [on hold]

Final exam is coming soon, we have to build two small business apps, Winforms and Webforms both uses same database and we are required to use pure Ado.net. So I thought of using an N tier architecture ...
0
votes
1answer
76 views

Is the regex syntax in .net 3.5 the same as the regex syntax in the latest version of .net framework in c#?

Is the regex syntax in .net 3.5 the same as the regex syntax in the latest version of .net framework in c#?
-1
votes
2answers
52 views

Appropriate Design Patterns [on hold]

I have a list of objects which represent log entries like below. List<LogEntry> Entries; //Log Entries Read By A Log Reader The Log Entry Class contains following properties. public class ...
0
votes
1answer
43 views

Custom serializer or create base class which implements IXmlSerializable?

I am working on a project where I have very specific xml serialization specifications, that is: Some properties are elements, some are attributes Some properties are required others aren't Some ...
0
votes
0answers
39 views

Is there a better way to retrieve a ViewModel container starting from a Model?

I'm trying to figure out a more efficient method. To start, I have a viewmodel wrapping around a model. The model itself collectively becomes a tree. We'll call each model a Fragment: public class ...
5
votes
4answers
646 views

How to add a property to an object you can't change?

Let's say that I'm using a library and I would like to add a property that doesn't exist to an existing class. In this case, I'd like to add Color as a property of Fruit. namespace Library { ...
0
votes
2answers
70 views

Data integrity, BinaryWriter, C#

I've developed a data acquisition system for a scientific experiment. An FPGA buffers the scientific data in a FIFO and a C# program empty this FIFO at a rate of ~45MB/s. Because the duration of the ...
0
votes
0answers
48 views

Offer limited feature in app [on hold]

I want to add a feature to my app that user can avail only twice or thrice in the trial mode. I am unable to figure out which purchase mode should I implement. I successfully implemented the ...
7
votes
3answers
464 views

Enterprise software: Where should the code go? [duplicate]

I recently went for an interview with a software company that claims to write enterprise level software. During the interview, the interviewer remarked that its better to use the database simply to ...
0
votes
1answer
69 views

Sharing core repository and object mapping logic between Unit of Work methods

I'm wondering if there is a better way to do this or if I'm doing some anti-pattern here. Like I say in the subject, I'm trying to share repository calls and object mapping logic between Unit of Work ...
0
votes
0answers
46 views

Enterprise Mashups. A good approach for .net

I'm in the middle of trying to talk our management into letting us do a portal that sits across the many, many systems that we use. I believe in using the best tool for the job so we have a good ERP, ...
-1
votes
0answers
39 views

Wpf reports for modern windows theme

I am a college student creating a WPF program for the 3rd year project. At this moment I have completed the most parts of the project. I want to know what are the available report types for WPF. The ...
1
vote
1answer
124 views

How much trouble can the use of Singleton class as Model cause?

In my latest WPF applications I've been using a Singleton class, that I call Model, to contain all my application's logic, such as file reading, information handling, etc.. In the WPF Views or ...
-1
votes
0answers
38 views

What are the differences and/or purpose of these assemblies? [migrated]

What is the difference and purpose of assemblies located in C:\Windows\assembly in C:\Windows\Microsoft.NET\assembly Which one are used by intelisense?
0
votes
0answers
31 views

How should I develop Web App DB with Azure continuous [closed]

I want to develop new Web App with Microsoft Azure. I have a repository on Bitbucket. The Continuous Delivery with Azure is set up, so when I push my changes Azure builds the app and deploys it to ...
-4
votes
0answers
44 views

How to evaluate your programming ability [closed]

I'm diving deep into C# and I want to evaluate my progress. How could I guague my ability in C# compared to others? Is there a service that gives me a numerical score? I've looked and I couldn't ...
3
votes
2answers
135 views

Factory for creating a singleton instance

We have some legacy code that has a bunch of singletons all over the place (written in C#). The singleton is a fairly "classic" implementation of the pattern: public class SomeSingleton { ...
2
votes
2answers
200 views

Where to put a common database connection for my classes

I have several classes (Repositories) which do the task of saving/retrieving some objects in/from database; all of them need to establish a connection to one database. I thought in order to avoid ...
-2
votes
0answers
84 views

How much developer efficiency would be lost switching from C# to C++ [closed]

If you switched from C# to C++ how much less developer efficiency would there be? There could be benefits in using c++ for cross platform portability as demonstrated by Herb Sutter ...
1
vote
1answer
48 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 ...
2
votes
2answers
65 views

Sharing info objects between objects?

I'm making a game and I have several cards that are created during the game. Each card needs some info, which is shared between cards of the same type. So I have a class CardInfo, which holds a name ...
1
vote
1answer
47 views

Down Sides to Using Properties as Opposed to Method Variables [closed]

I am debating the pros and cons of a couple of utility classes I have. The classes have a couple of properties which are set prior to calling the class methods. However, I was wondering if there are ...
0
votes
1answer
54 views

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

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
88 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 ...
10
votes
3answers
1k views

How to monitor a long-running program programmatically

What I've currently got can be summed up with this pseudo code: public static void Main(string[] args) { var listOfObjects = Database.GetObjectsToUploadToOnlineService(); ...
0
votes
0answers
69 views

C# async method on Windows Phone 8.1 (Nokia Lumia 920) [migrated]

I am trying to better understand Windows Phone 8.1 app development and thought it might be smart to start with a sensor application. So, using examples from around the web, I was able to figure out ...
2
votes
1answer
112 views

Alternatives to #if when polymorphism doesn't seem possible

There are couple of places where #if seems to give you abilities that polymorphism doesn't: Conditionally specifying base class When a section contains code that is not recognised by a compiler on ...
-1
votes
0answers
22 views

Passing Textbox value to Crystal Report Parameter c# [migrated]

Could someone please help with my problem. I already have the codes for this but I can't seem to combine the two. Legend: dt1 = Dataset; crpt = Crystal Report File This is my code for loading the ...
2
votes
2answers
159 views

How/when to “build” a Singleton that stores configuration data

I am a junior developer (think "intern-level" experience) working at a small shop more or less alone on a project that consumes data from a database, processes it, and inserts the results into another ...
1
vote
2answers
281 views

Generics in C# Test Class

I'm learning about unit testing in C#. Languages_Service and PlaceOfWork_Service are classes for SOAP services which Microsoft Navision generated for me. There are several methods that are very ...
1
vote
0answers
135 views

Dependency injection, but not into a controller [migrated]

I recently began experimenting with DI. I am using Unity Ioc to inject an EmailService from by Business Logic Layer into EmailServiceWrapper in the presentation layer which is then instantiated, my ...
-1
votes
1answer
61 views

Any library or dll to use to give a free lancers project from clients who accept your work but not pay [closed]

I've been thinking about getting into the free lance field (using sites like guru.com or freelance.com). Something I see in the FAQ's is that there's been numerous instances where the client got an ...
-1
votes
1answer
52 views

MVC Best practices: Do error message modals need a controller method? [closed]

I am creating a ASP.NET MVC C# application were I have a modal where that takes a value and then if the value is wrong another modal would pop up displaying an error message with an "Ok" button that ...
1
vote
1answer
95 views

Excel worksheet population and fomatting is slow

I have written a VSTO plugin in C# which populates several worksheets. During the population process cell values or formula are added one at a time according to user-definable criteria taken from a ...
0
votes
0answers
39 views

Creating Dynamic Odata Feeds at runtime, c# [closed]

EDIT I need a dynamic odata service to which I can pass a sql query and have it return the related fields, without the use of entity framework. Obviously security is a must so I would implement some ...
1
vote
0answers
60 views

Partially Fulfilled Specification Pattern

We have a model (IPayableModel) with a boolean property indicating that a user may or may not pay for the item. A set of specifications defining criteria that would disqualify the model from payment ...
-1
votes
1answer
58 views

How to upload a C# project to Github without visual studio [closed]

I would like to know How to upload a C# project to Github without visual studio? What do i need and how would I do it?
0
votes
0answers
56 views

Using xsd2Code and custom c# classes

I am using the xsd2code class generator to generate classes based on a schema file provided by a system vendor. This vendor also provides a REST API to access data via Web Services, and I've had a ...
-3
votes
2answers
124 views

Confusion about Constructors and properties [closed]

So im doing a project with a guy and I see in His code something like this: public class Foo() { private string example; public String Example { { get; set; } } public ...
1
vote
2answers
88 views

To convert to accurate data types or maintain default type of string

Scenario: I have a web application that records and checks data against two temp tables (1 table being a temp source and the other being a destination for the application). These temp tables are ...