Tagged Questions

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

6
votes
3answers
122 views

Building a string translation database for multiple (in-house) projects

At our company we have an existing translation ms-sql table wich stores strings like this: Id | Key | Language | Value 1 | hello-world | nl-BE | Hallo Wereld 2 | hello-world | en-GB ...
-2
votes
1answer
44 views

Best way to program a WebService for uploading files [closed]

For a greenfield project I have the following demands: must be C# must be using HTTP(S) protocol Consumers must be capable of uploading files by using a webservice. What is the best approach to ...
1
vote
1answer
68 views

Storage and naming of log data

I'm in the process of rewriting a small application from console mode to a GUI mode. The input is a file with log data from a measuring device: ... 00029;00044;00076;00044;00021 ...
5
votes
2answers
253 views

Use of “is” and “as” in multiple conditions

Quite recently, I thought about the use of as, is and direct cast in C#. Logically, is it a better idea to use : var castedValue = value as type; if (null != castedValue) { // Use ...
1
vote
0answers
33 views

Storage Client Library 2.0 - Why is the API not as intuitive to use as 1.7?

I am migrating to using the new Storage Client Library for my Azure Table Storage. Querying with the previous Storage Client Library 1.7 namespace: var orders = serviceContext ...
2
votes
1answer
85 views

What kind of abstraction/SoC should I use here?

I am starting a new project, and I want to follow the separation of concerns pattern, and I have been reading on the topic, and now I am in doubt of how I should go about this. Here is how I ...
6
votes
2answers
229 views

Is there a proper way to create a file format?

I'm building a proprietary file format for an application I wrote in C# .NET to store save information and perhaps down the line project assets. Is there a standard on how to do this in any way? I was ...
3
votes
1answer
113 views

Rosyln versus T4 for code generation [closed]

So I have a lot of knowledge invested in T4. I've wrote a few code generators of varying complexity and generally love it with the caveat of code-generating-code being difficult to unit test(but I ...
8
votes
1answer
131 views

Unit testing on visualization (3D graphics) frameworks

This is a follow up to this question. There I was asking how to do unit testing when you have a library of scientific algorithms. I have a similar problem now but with a different project. I'm ...
-3
votes
0answers
44 views

how is MVC model is used to access data from mssql to view [closed]

any one know the exact flow of take data from sql using model and pass that data to view. Please tell with examples. situation: I have a table of user details that details must be shown in view ...
5
votes
3answers
129 views

BackgroundWorker vs. Async/Await

I am new to C# development and wish to create a more responsive UI. In my preliminary research, I have seen two methods for achieving this: Multi-threading in conjunction with the BackgroundWorker ...
3
votes
3answers
175 views

Should I use abstract or virtual methods?

If we assume that it is not desirable for the base class to be a pure interface class, and using the 2 examples from below, which is a better approach, using the abstract or virtual method class ...
9
votes
3answers
132 views

Best way to unit test methods that call other methods inside same class

I was recently discussing with some friends which of the following 2 methods is best to stub return results or calls to methods inside same class from methods inside same class. This is a very ...
5
votes
1answer
99 views

Unit testing for a scientific computing library

I've had a bit of experience with unit testing before, in what I call (not pejoratively) the classic software engineering project: an MVC, with a user GUI, a database, business logic in the middle ...
4
votes
3answers
338 views

Novel polymorphism - any reasons for this code?

As part of my work on a legacy C# application I've come across a novel (to me) use of an interface & concrete implementations. I can't think of any reason why you'd do the following, but I'm ...
1
vote
2answers
237 views

coding style for If condition [duplicate]

I came across below style of writing if statements in C#, on msdn code examples. Usually when I write if statements, the conditions I would write `(Customer != null) I want to know if there is any ...
3
votes
7answers
205 views

Naming guard clauses that throw exceptions

I have a function evaluate() that parses a String for some variables and replaces them with their corresponding value: public String evaluate() { String result = templateText; for ...
-3
votes
0answers
108 views

Problem with key mapping in a simple game [closed]

I have a little problem trying to create a simple snake game in a basic tile engine. I have never worked with C# or Windows Forms and currently in a learning stage. I'd appreciate any help I get from ...
0
votes
1answer
149 views

How can my code structure be improved? [closed]

I am looking for advice on the neatest way to structure my code. class Password { private string cipher; Password(string cipher) { this.cipher = cipher; } public string ...
4
votes
3answers
135 views

How do ORM'S manage CRUD operations in multi thread environment

Suppose I have code which retrieves an object and modifies it and submits it via any ORM from a web application. Below is the pseudo code: First request var objCust = ...
3
votes
1answer
56 views

Should web service response use a base class or generic class?

In my RESTful WCF web service I have something like the following response object. public class WebResponse<T> { public bool Success { get; set; } public T Data { get; set; } ...
3
votes
2answers
188 views

I need advice developing a sensitive data transfer/storage/encryption system

I got closed on SO and told to post this here as it's about general application design as opposed to specific code. Intro I'm currently working on a project which involves the daily extraction of ...
3
votes
2answers
88 views

Domain Services as facades

I read .NET Domain-Driven Design with C#: Problem - Design - Solution and I noticed that the author created a domain service for each aggregate root. However, the domain services were only facades to ...
0
votes
1answer
128 views

Is C# namespace should be Project-Name?

I am working with multiple websites (freelancer) and a good amount of them I write using C# MVC4. I created a very good boilerplace project that I plan to use on every next starting mvc4 application ...
2
votes
3answers
99 views

Is it possible to get dynamically generated html in asp.net tags using HTTP Modules?

I want to know if it is possible to write to a log/text file dynamically generated HTML in asp.net tags in an .aspx page using HTTP modules. By dynamically generated HTML, I mean the html content ...
-6
votes
4answers
194 views

List of performance gains on using C++ instead of C# .net? [closed]

I want to write a low level graphics renderer engine. I will prefer C/C++ for performance. But what are the exact factors on performance gains? Garbage Collection is the one I know of. What about ...
3
votes
1answer
45 views

How to best distribute client specific configuration settings

I'm writing a WinForms desktop application which will be shipped out to several different clients and am wondering what the best way to implement a user configuration file is. Normally I would use the ...
4
votes
3answers
311 views

Is there a cleaner way of caching data

We've started implementing some caching code in our MVC project. We've derived from .Net's ObjectCache to store it in a SQL database. What we do right now is in each method we want to cache we have ...
-1
votes
0answers
21 views

Opening and closing database connection for each query [migrated]

I have written following code. I have opened the database connection for once for one query I want to execute another query. I have written the code below. But i think there is a mistake Can anyone ...
6
votes
2answers
301 views

Why do we need the async keyword?

I just started playing around with async/await in .Net 4.5. One thing I'm initially curious about, why is the async keyword necessary? The explanation I read was that it is a marker so the compiler ...
3
votes
7answers
311 views

Should object oriented programming be the first thing students learn? [closed]

My high school is starting a program where, instead of following the 'traditional' method of teaching programming (learning variables, then operations, loops, methods, and finally OOP), students are ...
10
votes
4answers
409 views

Always pull out common cases and branch separately? [duplicate]

We had a disagreement in a code review. What I had written: if(unimportantThing().isGood && previouslyCalculatedIndex != -1) { //Stuff } if(otherThing().isBad && ...
2
votes
1answer
192 views

The array class in C# - Implementation questions

I am studying the Array class in C#. The following is the implementation of System.Array class: [SerializableAttribute] [ComVisibleAttribute(true)] public abstract class Array : ICloneable, IList, ...
1
vote
2answers
218 views

Nested Enum type in C++ or C#?

I've come across a recurring issue in a few of my recent projects in which I find myself using enums to represent state, or type, or something else, and I need to check against a few conditions. Some ...
-5
votes
0answers
65 views

web application on employee performance appraisal [closed]

I have no base on any web application IDE's and our teacher gives us a school project on employee performance appraisal web application. and i guess its better to know asp.net MVC first. so can you ...
0
votes
1answer
54 views

Configuration file for an API - should it be web.config?

I have a remote procedure call API where the connection parameters need to be stored somewhere that the API code can access. This API is expected to be used mainly to create web services. I ...
-5
votes
0answers
96 views

What questions should I expect to be asked in 2nd technical round for Team Lead position for c# .net [closed]

I have interviewed by a software company in india for 1st technical round which take a hour. It was a telephonic interview and next day I get updates from HR that I am selected for 2nd round of ...
-2
votes
0answers
47 views

Wpf datagrid share width [closed]

I have a datagrid with 6 DataGridTextColumns I want to have a grid above my datagrid and the grid ColumnDefinition must be the same size of datagrid colums. any ideas how this can be done in Xamel?
-2
votes
0answers
39 views

OData Clarity Questions [closed]

I recently started working with OData and had a few questions. Perhaps some of you may be able to shed some light. To start OData doesn't seem to work well when there is some form of business logic ...
0
votes
3answers
155 views

C# dynamics and Expando object [closed]

Under which application development scenarios C# dynamics and ExpandoObject can be used or when to consider using c# dynamics and ExpandoObject
-9
votes
0answers
95 views

tell a friend c# cant fix [closed]

here is my back end for my code. using System; using System.Data; using System.Configuration; using System.Collections; using System.Net.Mail; using System.Web; using System.Web.Configuration; using ...
29
votes
1answer
1k views

Why does the .Net world seem to embrace magic strings instead of staticly typed alternatives?

So, I work in .Net. I make open source projects in .Net. One of my biggest problems with it isn't necessariyl with .Net, but with the community and frameworks around it. It seems everywhere that ...
-4
votes
0answers
43 views

How to change the color of Specific Word in Richrextbox [closed]

How does this work with WPF? .CS Code at: How to Change the Color of Specific Word in Richtextbox using C# My current path is very resource-eating.
2
votes
2answers
119 views

Style for creating IEnumerable unions

There isn't any cool LINQ sugar for creating unions. The Enumerable.Union() method is usually called like this: var bigList = list1.Union(list2); The alternative is to call Enumerable.Union() which ...
0
votes
0answers
80 views

ASP.NET Mvc3 - application/request lifetime and dependency injection

I thought of asking on SO, but it seems this is more of a "concept" type question than a "problem" type question. If it needs to be moved, please do so. Anyway, I'm having a tough time finding ...
4
votes
2answers
275 views

Is it possible to avoid enormously big switch in that case? [duplicate]

I'm writing a simple chess-related code with intention to write it clearly (performance doesn't matter at all). And this method I have doesn't look clean to me at all: public static Piece ...
-2
votes
0answers
128 views

Where are the Ruby on Rails jobs at outside of Silicon Valley? [closed]

So I'm a C# developer with 12 years experience who is learning Ruby on Rails and I actually love developing on the Rails platform. I'd like to transition to working with it professionally. However, it ...
2
votes
2answers
187 views

Elemental access in arrays

I was reading up on data structures from Code Complete. This is when I stumbled through this piece about arrays: Think of arrays as sequential structures Some of the brightest people in computer ...
4
votes
2answers
300 views

Event Driven Programming: A sequence of unfortunate events

I have a very basic game loop whose primary purpose is to check for updates & changes to a list. I have contemplated using event driven programming to replace the game loop/list idea with an ...
-4
votes
0answers
69 views

Looking for best Microsoft Certified Solutions Developer(MCSD) Online Course [closed]

I wanted to do a Microsoft Certified Solutions Developer(MCSD) online course. I am looking for the best place to get it trained. Can anybody help me to reach a best place to do my Microsoft Certified ...

1 2 3 4 5 24