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

WCF service and security

Been building a WP7 app and now I need it to communicate to a WCF service I made to make changes to an SQL database. I am a little concerned about security as the user name and password for accessing ...
1
vote
2answers
126 views

OSS - GPL v3 plugins in non-copyleft codebase.

I've been working on software to modify a game's resource files, and I'm planning on releasing it in open source. I'm perfectly fine with releasing my code under gpl v3. However, I'm afraid that ...
1
vote
1answer
604 views

Abstraction Layer over ORM Generated Entities

I am learning LINQ to SQL (and planning to learn Entity Framework). Initially I used a abstraction layer to convert LINQ to SQL entities into a domain objects. Later I discovered the “Inheritance ...
16
votes
7answers
2k views

What is the correct order to read these books? [closed]

I'm a junior C# developer, I learned at home and now I got my first job :) I want to buy these books. But what is the correct order to read these books? Code Complete: A Practical Handbook of ...
4
votes
2answers
616 views

Storing IEnumerable as instance variable - is it a code smell to expect it to change?

I have something that works like a fixed size list - it's actually called FixedSizeStack<T> in my program. I will use it to represent the X last occured events. This event list will then be ...
5
votes
3answers
3k views

How to make Unit Tests to make sure stored procedure is deleting row from the database?

I'm new to unit testing and I need some help with the following. I have created a small project to help me learn how to make Unit Tests. The functionality for one of the forms in my application ...
2
votes
2answers
2k views

Is this method of writing Unit Tests correct?

I have created a small C# project to help me learn how to write good unit tests. I know that one important rule of unit testing is to test the smallest 'unit' of code possible so that if it fails you ...
18
votes
6answers
20k views

Advantages and disadvantages to using XAML/C# or HTML5/JavaScipt for Metro apps? [closed]

I was just wondering if there are any major advantages or disadvantages to using either XAML/C# or HTML5/JavaScript for Metro Apps.
46
votes
8answers
5k views

Why a static main method in Java and C#, rather than a constructor?

I’m Looking for a definitive answer from a primary or secondary source for why (notably) Java and C# decided to have a static method as their entry point, rather than representing an application ...
31
votes
4answers
4k views

Why does F# have an interactive mode but not C#?

F# comes out of the box with an interactive REPL. C# has nothing of the sort and is in fact kinda difficult to play around without setting up a full project (though LINQpad works and its also possible ...
0
votes
3answers
610 views

What are the pre-requisites for writing .NET web services?

I am very new to web development. I have been a C,C++ programmer for 5 years and I'm starting to get into the web development, writing web services, etc. I understand that basic concepts of web ...
2
votes
4answers
683 views

Do I lose anything by coding in c# and using free online vb.net code convertors? [closed]

The company I work for uses vb.net since there are many programmers who moved up from vb6 to vb.net. Basically more vb.net resources in the company for support/maintenance vs c#. I am a c# coder and ...
5
votes
2answers
1k views

Should I expose IObservable<T> on my interfaces?

My colleague and I have dispute. We are writing a .NET application that processes massive amounts of data. It receives data elements, groups subsets of them into blocks according to some criterion and ...
-2
votes
1answer
261 views

Single Responsibility Principle: Responsibility unknown [closed]

I store sessions in a SessionManager. The session manager has a dependency to ISessionPersister. SessionManager private readonly ISessionPersister sessionPersister; public ...
3
votes
4answers
8k views

Practical size limits of a DataTable in c#

I have to query a large data-set (~500 MB) using a sqlDataReader but I have to save the data in three different formats. Instead of querying the database 3 times I'm thinking about saving the data to ...
7
votes
1answer
8k views

Future of WPF and free controls ? [closed]

I am willing to work on a personal project that I would like to release publicly. I am working with Silverlight and have experience with XAML, as it is my full-time job. It is enjoyably for me to ...
3
votes
1answer
322 views

Is the structure used for these web pages a design pattern?

I want to know if the structure for an ASP.NET website I'm working on uses a design pattern for it's web pages. If it is a design pattern, what is it called? The web pages have the following ...
4
votes
1answer
1k views

Designing a Content-Based ETL Process with .NET and SFDC

As my firm makes the transition to using SFDC as our main operational system, we've spun together a couple of SFDC portals where we can post customer-specific documents to be viewed at will. As such, ...
2
votes
1answer
3k views

Best way to reuse common functions between ASPX pages ?

I have a bunch of functions that are used across multiple ASPX files. I want to condense these down to one file to be used for all the ASPX files. I have a few ideas but I want to know what the ...
3
votes
2answers
2k views

Should this code/logic be included in Business Objects class or a separate class?

I have created a small application which has a three tier architecture and I have business object classes to represent entities such as User, Orders, UserType etc. In these classes I have methods that ...
7
votes
3answers
10k views

Best Architecture for ASP.NET WebForms Application

I have written an ASP.NET WebForms portal for a client. The project has kind of evolved rather than being properly planned and structured from the beginning. Consequently, all the code is mashed ...
7
votes
6answers
16k views

What's the point of passing a parameter by reference in C#? [duplicate]

Possible Duplicate: Why are objects passed by reference? Doesn't C# send the objects themselves? So unless it's some kind of swap function for primitive typed variables - why would I send ...
4
votes
5answers
2k views

Overwhelmed by complex C#/ASP.NET project in Visual Studio 2008

I have been hired as a junior programmer to work on projects that extend existing functionality in a very large, complex solution. The code base consists of C#, ASP.NET, jQuery, javascript, html and ...
-1
votes
1answer
790 views

Design Pattern for building a Budget [closed]

So I've looked at the Builder Pattern, Abstract Interfaces, other design patterns, etc. - and I think I'm over thinking the simplicity behind what I'm trying to do, so I'm asking you guys for some ...
0
votes
1answer
325 views

Why would he say “We don't want to support MVC3”?

I work in a small shop at a fairly big company doing intranet web applications. By small, I mean there is 1 other guy in my position... and he graduated with me last December. (we aren't the only IT, ...
3
votes
1answer
964 views

How to refactor a method which breaks “The law of Demeter” principle?

I often find myself breaking this principle (not intentially, just through bad design). However recently I've seen a bit of code that I'm not sure of the best approach. I have a number of classes. ...
3
votes
2answers
316 views

Design suggestions needed to create a MathBuilder framework

Let explain what I'm trying to create. I'm creating a framework, the idea is to provide base classes to generate a math problem. Why do I need this framework? Because at first time, I realized when I ...
1
vote
2answers
760 views

Generate sequence of string of 4 characters

I'm facing problem with generating character sequence for SMS tracking. there should be a easy to enter code send with all the outgoing messages. Reply SMS will map with that code. I can't generate ...
5
votes
3answers
2k views

How should I structure a solution for a long term project?

I'm about to create a do-everything dashboard for my team and am still having second thoughts about my project/solution structure. Since this could be a long ongoing project, I want to get the ...
0
votes
1answer
2k views

Is this a good use for ThreadPool.QueueUserWorkItem?

I have an application that, among other things, imports documents, then emails necessary parties to let them know that a document has been imported. It turns out that determining whom to email, then ...
6
votes
3answers
510 views

REST: How to store and reuse REST call queries

I'm learning C# by programming a real monstrosity of an application for personal use. Part of my application uses several SPARQL queries like so: const string ArtistByRdfsLabel = @" PREFIX rdf: ...
0
votes
1answer
1k views

Database Driven Web Application, C# Front-End and F# Back-End meaning

Hi I am an intern working with ASP.NET. My current task is to make a website which will incorporate some jquery viewing features. This project seems to me will be primarily dealing with reading data ...
12
votes
5answers
4k views

What are some practical uses of the “new” modifier in C# with respect to hiding?

A co-worker and I were looking at the behavior of the new keyword in C# as it applies to the concept of hiding. From the documentation: Use the new modifier to explicitly hide a member inherited ...
6
votes
2answers
1k views

What's the best way to manage list item sort order with Drag & Drop UI?

I have a list of Students that I should display to user on a web page in tabular format. The items are stored in DB along with SortOrder information. On the web page, user can rearrange the list ...
11
votes
7answers
3k views

Difference between Pattern and Principle

What is the difference between Object Oriented Design Patterns and Principles? Are they different things? As far as I understood both of them try to achieve some common goal (e,g. flexibility). So can ...
3
votes
3answers
2k views

Partitioning set into subsets with respect to equality of sum among subsets

Let's say I have {3, 1, 1, 2, 2, 1, 5, 2, 7} set of numbers, I need to split the numbers such that sum of subset1 should be equal to sum of subset2 {3,2,7} {1,1,2,1,5,2}. First we should identify ...
3
votes
3answers
1k views

Using a back-end mechanism to copy files to DB and notify the application

This Scenario: User copies large files to a local folder. I want to watch that folder and when a new file is dropped then go and copy it to Database, so later when coping is done I can actually use it ...
2
votes
4answers
1k views

Splitting code from form operations in C#

I have a large (at least for me - approximately 10k lines) project that is written in C#. I have a treeview object on the left of my form and i have many nodes on my treeview. When i click a node, i ...
7
votes
4answers
473 views

Warn about 3rd party methods that are forbidden

Note: This question refers to code written in Java or C#. I am managing a couple of large projects where we have discovered issues (not necessarily bugs) with some 3rd party/SDK methods and have ...
10
votes
7answers
4k views

C# foreach improvements?

I run into this often during programming where I want to have a loop count index inside of a foreach and have to create an integer, use it, increment, etc. Wouldn't it be a good idea if there was a ...
5
votes
8answers
1k views

Is there a point to writing in C or C++ instead of C# without knowing specifically what would make a program faster?

I wrote a small library in Python for handling the xbox 360's STFS files to be used on my web applications. I would like to rewrite it for use in the many desktop programs people are writing for 360 ...
2
votes
1answer
917 views

Making Modular, Reusable and Loosely Coupled MVC Components

I am building MVC3 application and need some general guidelines on how to manage complex client side interaction between my components. Here is my definition of one component in general way: ...
5
votes
2answers
592 views

Design pattern for an automated mechanical test bench

Background I have a test fixture with a number of communication/data acquisition devices on it that is used as an end of line test for a product. Because of all the various sensors used in the ...
2
votes
1answer
1k views

const vs. readonly for a singleton

I have a singleton that anchors together some different data structures. Part of what I expose through that singleton are some lists and other objects, which represent the necessary keys or columns ...
10
votes
1answer
2k views

Using visitor pattern with large object hierarchy

Context I've been using with a hierarchy of objects (an expression tree) a "pseudo" visitor pattern (pseudo, as in it does not use double dispatch) : public interface MyInterface { void ...
1
vote
1answer
337 views

Do reactive extensions and ETL go together?

I don't fully understand reactive extensions, but my inital reading caused me think about the ETL code I have. Right now its basically a workflow to to perform various operations in a certain ...
13
votes
6answers
3k views

Is C# becoming harder to read?

As C# has progressed, many language features have been added. It has come to the point where it's becoming unreadable for me. As an example, consider the following code snip from Caliburn.Micro code ...
0
votes
1answer
832 views

An alternative to multiple inheritance when creating an abstraction layer?

In my project I am creating an abstraction layer for some APIs. The purpose of the layer is to make multi-platform easier, and also to simplify the APIs to the feature set that I need while also ...
1
vote
1answer
996 views

Flash messages in ASP.NET MVC without sessions

I'm developing a web application for Windows Azure using ASP.NET MVC 4. I would like to enforce one restriction in the architecture: do not use Session. To achieve availability on Azure, and since ...
40
votes
6answers
9k views

Single Responsibility Principle - How Can I Avoid Code Fragmentation?

I'm working on a team where the team leader is a virulent advocate of SOLID development principles. However, he lacks a lot of experience in getting complex software out of the door. We have a ...