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

1
vote
1answer
9 views

Separation of retrieving data and business objects between DAL and BLL Layers

I did some research before posting this question. Among other questions or post, one of those is provided below. I could not get a clear mind how to determine.. Business Objects within a Data Access ...
0
votes
0answers
20 views

External client connectivity via web service or mvc route?

I am faced with a business need and wanted some factual information before proceeding down one path or the other. I have an existing MVC 4 site. I need to make a "service" available to consumers such ...
1
vote
3answers
156 views

Is this extension method any better than just casting to an int?

The following extension method was set up in some code I maintain. public static Int32 GetInt32(this System.Data.Common.DbDataReader reader, string name) { return ...
3
votes
4answers
87 views

What is the best way to initialize a child's reference to its parent?

I'm developing an object model that has lots of different parent/child classes. Each child object has a reference to its parent object. I can think of (and have tried) several ways to initialize the ...
-2
votes
0answers
19 views

OpenTK - Selection/Picking Glu.PickMatrix not sizeable [migrated]

I am using an open source OpenGL library called OpenTK, and I have some trouble with Selection Picking. The program checks a specific matrixview ( i.e. 1x1 px) and returns the number of objects in ...
0
votes
0answers
12 views

What is the best way to initialize a child's reference to its parent? [duplicate]

I'm developing an object model that has lots of different parent/child classes. Each child object has a reference to its parent object. I can think of (and have tried) several ways to initialize the ...
0
votes
1answer
76 views

IOC Between Presentation and Infrastructure Layer

Question: I would like to set forth dependency mapping from a *.config file from a project that has no reference to the project that contains the concrete class. Scenario: I'll be using terms from ...
1
vote
0answers
69 views

Better to keep JScript.NET dll or try converting JScript.NET code to C#?

Let me explain the back-story to my question: I have made a .NET program that logs into an account on a website and scrapes various pages of information. In order to login to the website, I must ...
0
votes
0answers
59 views

Building an email-connector in C#

I'm currently in the process of building an email-connector in C#. It is used to receive emails via IMAP, POP3, et cetera (and storing them in my database) aswell as sending via SMTP. Now I was ...
-2
votes
0answers
42 views

How to disable mscorelib.dll from within visual studio 2013? [on hold]

I am trying to use a custom standard library in visual studio 2013 and can't seem to figure it out. I have no problems compiling on the command line using /nostdlib although I would like to be able to ...
2
votes
2answers
156 views

Interface to enumerate over files

I'm trying to design a generic interface for enumerating over a list files. Each iteration will open a file, allow the consuming code to access the file to perform some task, and then close the file. ...
5
votes
2answers
230 views

Should the sender of an event always be a generic Object?

When programming events in C#, it is advised to create a delegate in form of: delegate XEventHandler(object sender, XEventArgs e); My question is on the first argument of the delegate, object ...
0
votes
1answer
43 views

setting class members automatically like Photon Servers Operation class does

I'm wanting to mimic something that I saw in Photon Server with my application. Entity Framework does something similar. Photon Server has an Operation class. You pass it a dictionary of ...
2
votes
2answers
321 views

What is an alternative to bitwise flags?

I was trying to be smart and elegant, and I ended up shooting myself in the foot by coding my entire application to use flags to store various combinations of settings. Now, I have hit a point where ...
11
votes
4answers
2k views

Is it permissible to use explicit interface implementation to hide members in C#?

I understand how to work with interfaces and explicit interface implementation in C#, but I was wondering if it's considered bad form to hide away certain members that would not be used frequently. ...
-5
votes
0answers
16 views

Gridview update when binding???How to update it??? as iam using Textbox within that gridview? [on hold]

How to upadte the gridview???which contain textbox within the gridview. <Columns> <asp:TemplateField HeaderText="Years" ItemStyle-Width="10%"> ...
0
votes
0answers
31 views

Nhibernate operations on a separate thread for a desktop MVVM application

I am developing a single user .net desktop application that lists numerous (over 2000) contacts sorted by an algorithm. I use NHibernate and did consider a session per use case (or conversation as it ...
-2
votes
0answers
26 views

Pull Data from WPF RadioButton [on hold]

Ok, so I am new to WPF, and I ran into an issue. I am doing some form handling with a sql query and some form fields. Here is my code: using (SqlCommand cmd = new SqlCommand("INSERT INTO LogData ...
3
votes
1answer
91 views

why Web API 2 has RouteConfig.cs file?

I m working on Web API project, and it is using WebApiConfig.cs file to defined routs for Web API. Web API fold RouteConfig.cs file. I have googled and they say RouteConfig.cs is for MVC routing. It ...
0
votes
2answers
244 views

Do GC generations have any purpose (for an application programmer) other than answer to “tricky” HRs' questions?

I'm using C# for a several years, never actually willing (until I really need to) to dig into its "deep" mechanics and to intervene in GC work, IL-compiled code and so on. My point is if you ever ...
17
votes
7answers
2k views

What can one do to improve readability of math-oriented code in C#, Java, and similar? [closed]

As both a C programmer and a C# programmer, one of the things I don't like about C# is how verbose math functions are. Every time you would have to use a Sin, cosine, or power function for example, ...
3
votes
1answer
196 views

How to store a potentially large amount of optional properties of objects?

I'm using Entity Framework Code First with ASP.NET MVC. This handles my database design based on the domain models within my application. As it stands, the engine I'm writing will have a website ...
-1
votes
2answers
107 views

Moving old desktop application to a robust platform [closed]

Several years ago I wrote a desktop application, a small accounting system, in Delphi 7, that is in user in a medium-sized company. The code belongs to me. I ported another Accounting system that I ...
1
vote
2answers
200 views

Decide the type of an object during runtime

I try to implement a PriorityQueue with C#: public class PriorityQueue<T> : Heap<T> where T : IComparable<T> { ... } The Heap is abstract. I have MinHeap and MaxHeap that are ...
1
vote
1answer
67 views

Tell, Don't Ask and Immutability in a non-directional network

I'm working on a small project in which I'm attempting to practice relatively strict adherence to two ideas: Tell, don't ask (TDA) Immutability The main concept in this project is a Map (as in a ...
0
votes
1answer
58 views

Strategy for creating a websocket relay?

I own a Raspberry Pi and would like to use it as some sort of websocket relay, so that all people who visit a specific webpage would be able to communicate with each other. The key thing about this is ...
2
votes
1answer
53 views

Design Question - System Integration

Guidance on good application architecture / design is not in short supply however most of the examples focus on some business object, like Customer and its behaviour and persistence. There is little ...
-3
votes
0answers
16 views

send generic list from server to client and then client to server [migrated]

I have a asp.net page, list is generated after post back. List needs to be first updated at client side and then it needs to be updated at server side before showing results on the page. I don't ...
1
vote
1answer
121 views

Implementing a tricky REST API with ASP.NET Web API

I'm trying to build a RESTful API using ASP.NET Web API for a game, and here are the methods I have so far: /games GET /games/:id GET /games POST /games PUT /games DELETE /users GET /users/:id GET ...
0
votes
1answer
116 views

How can I mock this architecture?

This is not a very general question, so it may not exactly be appropriate here, but I could sure use a suggestion if you have one: I have an object containing a dictionary keyed off of an enum, ...
2
votes
1answer
159 views

In a generic method, what exception should I throw when a type parameter is unacceptable?

When the value of a normal parameter is unacceptable (and the requirements can't be checked completely at compile time), we check at runtime and throw an ArgumentException if the check fails. When ...
9
votes
3answers
668 views

In TDD should I have to write Test first or Interface first?

I am learning TDD using c#, as far as I know test should drive the development, that is first write a failing test after write the bare minimum code to pass the test then do refactoring. But it is ...
-2
votes
0answers
48 views

Can model driven development coexist with test driven development?

I am currently learning Test driven development in c#, in order to get the balls rolling I have created a c# project in visual studio to design TIC TAC TOE with some abstraction. For that I need a ...
3
votes
1answer
124 views

Implicit Conversion Operators for Value Types in C#

I’ve come across this blog article: Implicit Conversion Operators are Bad. The article discourages the use of implicit conversion with reference types. The article describes problems caused by ...
-1
votes
1answer
78 views

SQLDatabase: Read a lot of data at once and process in memory or read the data when I need it?

I'm not sure how to approach this problem. I require a big chunk of data records from the SQL server. This chunk is based on variables, so I don't know before what records I need. I need to do a large ...
4
votes
2answers
263 views

Is it better to create thread safe subclasses or make the main class thread safe?

Say we have a class that is frequently used in a single-thread context: public class Foo { public List<Bar> Data; public virtual void ChangeData() { for(var i =0; i < ...
3
votes
0answers
78 views

How to efficiently implement this background processing chain?

I am working on an audio software that uses The EchoNest web service to identify and retrieve metadata about audio songs and I would like to have some advice on implementing a background processing ...
0
votes
2answers
234 views

What's the advantage of auto-property initializers without primary constructors?

In this chart about the features that are in or out of the next version of Roslyn (specifically, for C#), primary constructors are out, but auto-property initializers are in. The best use case I've ...
1
vote
2answers
118 views

Naming conventions DAL, BAL, and UI Layer [closed]

I am developing a typical Web Application with the following layers UI Layer (MVC) Business Logic Layer (BAL) Data Access Layer (DAL) Each layer has its own DTO object including the BAL and DAL. ...
0
votes
1answer
42 views

Custom mobile app and custom server app [duplicate]

I have this little bit simple and general question. Let's say I build an android app which requires an online server to communicate with. The thing is that I want to make the communication on my own ( ...
4
votes
1answer
377 views

avoiding multiple calls to SQL while being modular

I have a BusinessLayer.dll which calls DataAccessLayer.dll which ultimately makes the tcp connection to the SQL server. Each business layer method has a corresponding method in the data access layer ...
2
votes
1answer
88 views

Pattern to gain abstraction over assembly with no abstraction

I'm interacting with a large code base (in a single assembly) written by another department (let's call it BusinessAssembly). Precious few of the objects we need to use in that assembly use ...
0
votes
0answers
7 views

Need Unity help [migrated]

Before I start I should mention I am a unity noob. So I have been following a pong tutorial,but I have a problem. The rackets are not moving when you press the arrow. If you know how to fix this ...
2
votes
1answer
157 views

Should you reuse an Entity Framework EDMX between multiple solutions?

We currently have 1 giant EDMX for our corporate database. It, along with all of the generated POCOs, are in a separate project (we'll call it the EDMX project) which we pull in to any solution that ...
0
votes
1answer
147 views

I/O bound or CPU-bound

I have a telephony application, there is a windows service(third party product) running on a remote server. The application runs against the server. To connect the server, we have the code. public ...
1
vote
1answer
183 views

Exceptions: What to handle, what to throw

I have a custom configuration reader which performs various functions on top of .NET's CloudConfigurationManager and ConfigurationManager implementations, such as caching, type conversion, etc. The ...
3
votes
2answers
168 views

IoC as service locator

I have been wondering for quite some time on some issues while using dependency injection: In a layered application, I normally inject repositories into the application service using constructor ...
0
votes
1answer
91 views

Best practise to versioning Web Service WCF

I've a web service SOAP developed with WCF, there is a best practise to versioning it? when I change the contract I don't want to update all the client's referiments but I want simply publish a new ...
1
vote
2answers
125 views

Deriving from a class only to provide a special constructor

In our codebase, I encountered the following construct: There is a base class B, and then there is a class D which derives from B, but does not override or add any members. In fact, D is completely ...
0
votes
0answers
4 views

Using Take() with bindingsource [migrated]

How to use Take() with the following code? var context = new Entities(); BindingSource bi = new BindingSource(); var TableName = cboSelectTable.Text.ToString(); bi.DataSource = ...