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
0answers
21 views

Design Structure/Data Structure thoughts needed

I am reading a Binary file, it has several blocks, each block has different names/data. Some of this data is string value, date, datetime, time but most of them are integer value. Previously I code a ...
1
vote
0answers
31 views

Reducing repetitive DI code

I have a method which constructs dependencies using Unity. Currently, all of the calls do pretty much the same thing: Registers 2 repository object and 2 'App Part' objects. My issue is, there's a lot ...
0
votes
0answers
10 views

Trouble Getting C# Graphics to work in Form [migrated]

I am trying to make a C# Windows form in Visual Studio so I can draw on the form (like a basic version of Microsoft Paint). I am working through an example in a C# 2012 book. I have written the code ...
0
votes
2answers
115 views

embedding programming languages into other languages [duplicate]

In C/C++, there is a keyword that allows you to enter assembly language directly into a method. Example int Main() { __asm // notify the compiler that this block is assembly language. { ...
1
vote
1answer
21 views

Use ILmerge for NuGet libraries?

I'm making an open source C# library (http://github.com/eteeselink/fakethat if you must). Like is fashionable these days, I plan to spread it via NuGet. My library depends on another library ...
2
votes
2answers
77 views

Lazy loading if collection would have any entries

I often see model classes with properties like this: public IList<Note> Notes { get; set; } public bool HasNotes { get; set; } Where the list is initialized lazy, but the boolean property is ...
1
vote
3answers
102 views

Unit-Testing functions which have parameters of classes where source code is not accessible

Relating to this question, I have another question regarding unit testing functions in the utility classes: Assume you have function signatures like this: public function void ...
-2
votes
0answers
65 views

correct name for a method [closed]

I am struggling with a name for a method. The implementation is already done, I am just looking for a good name! potential candidates : Segregation Extract Split The Method IEnumerable< ...
0
votes
2answers
118 views

Similar references to themselves in two classes

How can I make 1 class (base, generic or something else) from these two classes? class A { A Link { get; set; } } class B { B Link { get; set; } } UPD: This is what I have now: class BSTree { ...
2
votes
2answers
155 views

Object Initializer in C# problem with readability

I wonder if object initializing have some performance gain in ASP.NET website. I have an office mate that told me that object initialization is much readable and faster than constructor. But one of my ...
-2
votes
0answers
46 views

Drawing 3D spheres in Windows Forms [closed]

I have to do a task assigned on Computer Graphics class. I need to create an application in Windows Forms that would display 3D spheres. Those are to be described in some config file (preferably) or ...
0
votes
1answer
54 views

Design question on best option to store data on remote computers

I'm making a windows forms application which I want to install on a few computers that are all connected together on a network. Each of these computers have access to a number of servers on which ...
0
votes
3answers
79 views

How to handle complex conditions? [duplicate]

We are working on project where we have to manage these conditions. i.e.: A User can save an order under these conditions: User has permission "SaveOrder" Order is in state "shipped" Online Shop is ...
5
votes
5answers
310 views

Why would a developer create a public class that has all static properties?

A previous developer has a couple public classes that do not inherit from any other classes but are filled with static properties. Is this another way of creating a struct or enum? Is this an older or ...
2
votes
3answers
348 views

Best way to check for specific types

Normally I do this: if (Animal is Dog) { Doc d = (Dog)Animal; // d. etc.. } else if (Animal is Cat) { Cat c = (Cat)Animal; // c. .... } Is this a good way or are there better ways ...
2
votes
2answers
61 views

Pattern to use for different Stages in a software

I am developing a software for a laboratory to test some devices. To test each device there are multi subtests which should be done to reach to the final result.To perform a complete test, the ...
0
votes
1answer
68 views

So Far what has the Roslyn CTP Been Used For? [closed]

All, I just wanted to know what you have or what you know other to have been doing with the Roslyn CTP. I am not asking Why would anyone invest time in Microsoft "Roslyn"?, but specifically ...
-2
votes
0answers
60 views

How to crawl a website/extract data into database C#(2012) and SQLSERVER2008 [closed]

There are few sites online who have categoriesed data/informations.I want to fetch/extract these informations and save it in my database. What are the ways/methods to get informations from websites? ...
-1
votes
2answers
128 views

c#/java or c++ (Personal question) [closed]

First of all this is not a comparison between the languages. So I've asked a question before telling that I am a beginner programmer (hardest thing done is a chat server/client when I was reading ...
-2
votes
2answers
54 views

An Algorithm for gridding a polygon in C# [closed]

There ids lots of program and algorithm for converting from bitmap into vector, but I want a simple algorithm to convert a polygon that determind with it's Points into a bitmap or mapping it on a ...
4
votes
1answer
181 views

Class Naming Conundrum

I am working on a personal project that works with databases, and in this project I have a set of classes that are similar, so they inherit from a common base class. The problem I am faced with is ...
1
vote
2answers
134 views

Need to develop a math script interpreter in C# [closed]

I don't know if this is the right name, but I want to develop a Math Script Interpreter in .NET—an application which will interpret and evaluate complex mathematical expressions. I am just ...
19
votes
4answers
692 views

Why do C# and Java use reference equality as the default for '=='?

I've been pondering for a while why Java and C# (and I'm sure other languages) default to reference equality for ==. In the programming I do (which certainly is only a small subset of programming ...
0
votes
2answers
90 views

Should I use different projects for building different layers in a 3-layer model?

I am creating a new project from scratch and have decided to use a 3-layer model. I am using: the 1st layer for business entities, the 2nd layer for business logic, and the 3rd layer for data logic ...
0
votes
0answers
28 views

SMTP traffic forward/relay?

We have three different networks. Regular, Trusted, Secure. Regular has access to the internet and trusted. Trusted has access to regular, internet and Secure. Secure has access to Trusted. We used ...
0
votes
1answer
71 views

How to store data for Windows Store apps?

I have a application which requires me to save data to a database not located on the users computer. Which approach is the best to save and access data for this scenario? Normally I would use Entity ...
0
votes
1answer
60 views

Would this development environment cover the bases for iOS and Windows 8/Windows Phone 8 apps?

I'm an experienced C# developer. I've created a couple Windows Phone apps and a Windows 8 app but have wanted to develop for iOS too. What I'm thinking is adding the following equipment and software ...
6
votes
3answers
294 views

Is the usage of internal scope blocks within a function bad style?

There are some (quite rare) cases where there is a risk of: reusing a variable which is not intended to be reused (see example 1), or using a variable instead of another, semantically close (see ...
4
votes
1answer
46 views

Controlling cookies with many tabs

I have a peculiar problem. My application has different levels of authentication. One specific level of user (super user) needs to be able to use the application as another user (subordinate user) ...
2
votes
2answers
125 views

Same constructor signature with different semantics?

Occasionally, I'm confronted with the problem that I have to provide some constructors in order to initialize objects with different sets of data. These sets can be mathematically transformed into ...
-1
votes
1answer
95 views

C# tool for real time code path visualization [closed]

I remember seeing a Visual Studio 2012 extension that added 'develop'-time support for executing methods and functions with mock data, in a very similar way to LightTable. Does anyone know what it's ...
4
votes
1answer
107 views

Is Code First with Migrations or SQL Server Data Tools a better fit?

I have been given a spec to create a new MVC4 website, it will not be too large a project at first but I suspect it will grow as the business gets new ideas for it. Using .NET 4.5 ASP.NET MVC4 and EF ...
0
votes
1answer
57 views

View is calling constructor method in the Model instead of passing model to the controller method

The problem is the UserTypes property (used to populate a drop down list in the AddUser view) is not being retained after POSTback of the form. Here is my AddUserModel: (which inherits from ...
-3
votes
7answers
301 views

Unit Test OR Console Application [closed]

I am to write some one-off code in c#.net that will do some db manipulation of existing records and call a third party REST Api to update those records. I proposed writing a unit test that does it. ...
0
votes
2answers
100 views

Need help understanding Constructor Chaining

I'm trying to understand constructor chaining better. I understand that this technique can be used to reduce code duplication for initialization of a class object and I also understand the order in ...
-1
votes
0answers
77 views

How to learn more about 3G, 4G and LTE as a programmer? [closed]

This is a very abstractive question but I am interested in programming on network and wish to learn furthermore about it. College that I am currently going to does not offer any subjects regarding to ...
-5
votes
0answers
122 views

Best way to get a C++ job, coming from C# [closed]

I am a software developer, experienced with C# (5 years experience) alongside a few other languages. My "dream job" is working in video games as a developer. Most jobs require knowledge of C++, ...
0
votes
1answer
50 views

Uses of WCF Binding

From MSDN, we have the following definition of WCF Binding Bindings specify how a WCF service endpoint communicates with other endpoints. At its most basic, a binding must specify the ...
3
votes
3answers
113 views

Is it bad practice to have FooObject and FooObjectSummary?

I have a service where users can upload/download/replace/delete files. These files have about a dozen attributes that are saved to a SQL Database. Periodicaly throughout their session they will have ...
0
votes
1answer
84 views

Is SOAP Http POST more complicated than I thought

I'm currently writing a bit of code to send some xml data to a web service via HTTP POST. I thought this would be really simple and have written the following example code (C#) ...
0
votes
1answer
81 views

How do you distinguish your public API interfaces from the interfaces you use for testing/mocking?

Mocking frameworks are useful for creating mock objects that isolate the code under test from its surrounding software environment. Some mocking frameworks cannot mock non-virtual methods, so they ...
2
votes
1answer
144 views

Creating an interface of interfaces

Background: We have a class that both listens on a socket and sets values on itself based on what it reads off the socket. I believe that adheres to SRP. To adhere to ISP we created one interface ...
0
votes
0answers
34 views

WCF Recovery implementations open source

I am looking for open source monitoring and recovery notes/samples for my Managed application wcf service/client architecture (.net 3.5/4.5). I am working with generic ServiceClient and ServiceHost. I ...
34
votes
11answers
2k views

I don't understand how TDD helps me get a good design if I need a design to start testing it

I'm trying to wrap my head around TDD, specifically the development part. I've looked at some books, but the ones I found mainly tackle the testing part - the History of NUnit, why testing is good, ...
0
votes
1answer
33 views

In which cases build artifacts will be different in different environments

We are working on automation of deployment using Jenkins. We have different environments - DEV, UAT, PROD. In SVN, we are tagging each release and placing same binaries in DEV, UAT, PROD. The ...
1
vote
2answers
146 views

Anemic Domain Model vs. DDD by definition example(s)?

What is an example of "Business Logic" that should reside in the DomainModel i.e. inside an Entity instead of inside a (Domain) Service, as well as some example logic that should be in a service. ...
1
vote
1answer
119 views

Does this violate the using exceptions for flow control “rule”?

I plan to make use of this interface in a plug-in architecture. /// <summary> /// Generic interface allowing you to react to an event. /// You can block the event or just use it for ...
2
votes
1answer
112 views

DDD/SOA in (.NET) MVC and Message pattern(s) / Request Response

We're currently considering whether it makes sense (or if the benefits are worth the added code) to introduce a Message based pattern (such as Request Response) into a Domain Driven Design / Service ...
0
votes
0answers
68 views

Why does DataContractJsonSerializer not include generic like JavaScriptSerializer?

So the JavaScriptSerializer was deprecated in favor of the DataContractJsonSerializer. var client = new WebClient(); var json = await client.DownloadStringTaskAsync(url); // ...
1
vote
1answer
158 views

Simple way to deploy Winform application to website

First of all, I know there is no perfect answer to my question. It is a bit personnal, but I'm sure many programmers face the same dilemma when they get from regular desktop applications to ...

1 2 3 4 5 27