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

-4
votes
0answers
29 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 ...
4
votes
2answers
381 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
35 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
36 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
72 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
51 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
30 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
35 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
634 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
69 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
461 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
35 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
30 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
197 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
83 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
64 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
86 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
157 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
279 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
58 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
49 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
92 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
57 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
54 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
123 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 ...
1
vote
2answers
137 views

How do I do SQL Server mapping with a new Desktop application written in C#? [closed]

In 2 weeks I will be starting a new job as a software developer in a company that currently does not employ any professional programmers. My first task will be to rewrite a Excel/VBA application in ...
2
votes
1answer
48 views

Two way communication between Form and plugins

I have started to develop a support tool for an old legacy system that is no longer maintained but still needed for the foreseeable future. The legacy system offers few, clunky and error prone methods ...
0
votes
2answers
81 views

Handling Business Logic/Validation Race Conditions

I'm working on a Training Enrollment web application with the following (simplified) features: Maintenance (Add, Edit, Deactivation) of Trainings Student sign-up Student enrollment to Active ...
160
votes
9answers
11k views

Why do many exception messages not contain useful details?

It seems there is a certain amount of agreement that exception messages should contain useful details. Why is it that many common exceptions from system components do not contain useful details? A ...
1
vote
1answer
92 views

Under what cirumstances would type 'System.Object' qualify for serialization?

I'm in charge of a comprehensive serialization format with support to serialize runtime objects (any derived type of Object). I can't find a sane scenario where one would choose to serialize an ...
-1
votes
1answer
114 views

override resolution behavior in c#

I tried the following piece of code public abstract class Entry3 { public abstract void Method1(); public virtual void Method2() { Console.WriteLine("Entry3.Method2"); } } public abstract ...
2
votes
1answer
89 views

Ambiguity of seemingly clear method names in APIs

(The question is language-agnostic, but to illustrate the point, I wrote the examples in C#.) Say I'm trying to model the behavior of "components" that communicate via "ports". I might model this ...