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

-3
votes
1answer
18 views

Logical grouping of data file rows [on hold]

I am looking for an efficient way to group some values as follows: I have a tab delimited file that has some table data in a structure like: Name LastName SSN SomeID AnotherID Address ...
1
vote
1answer
90 views

Implementing IEnumerator without using 'yield return' in c#

I'm new to C# programming, I was experimenting with iterators concept in C#. Here, I'm trying to display all the terms in a list, for that I'm trying different ways to obtain the results. In the below ...
0
votes
1answer
34 views

Class and API Design suggestions [on hold]

I am looking for some good design suggestions for this scenario: I have a tab delimited file that has all the columns and data I need to import into our database. So the data is all there but in a ...
3
votes
0answers
65 views

Deferred execution of Dispose for IDisposable objects

I'm working on an application that does lots of encryption and decryption in-application and this is probably the number-one bottleneck, so I've been spending some time making performance tweaks to ...
2
votes
2answers
99 views

Is it useful to keep 'definition' entities in a database vs using an enum?

In a project that I have started working on, the database has a lot of FooDefinition tables which act like an enum. It's a C# project using Entity Framework although that is not central to the ...
-2
votes
0answers
56 views

Program that calculates and displays resistance [on hold]

The question is as follows: This problem is to do with electrical resistors, which 'resist' the flow of electrical current through them. An analogy is a hosepipe , a thin one has a high resistance, ...
0
votes
1answer
113 views

Onion Architecture Structure

I am looking to understand and implement the Onion Architecture and have a vague idea on how to structure everything but need help to clear up some of my confusion. Based on different examples and ...
2
votes
3answers
273 views

What is a good design for a method that can return several logically different results?

The question title is probably too abstract, so let me provide a particular example of what I have in mind: There is a webservice that encapsulates a process of changing passwords for users of a ...
-2
votes
1answer
75 views

Should I as a junior-programmer pursuit a course in C#, even though I did Java? [on hold]

I'm a junior-programmer, and at present I am pursuing a course in I.T. which involves getting to know Java and JavaScript. Should I pursuit a course in C# also? I really like programming, but I had a ...
0
votes
2answers
134 views

Comparing two software versions in C#

I´m working on a mod update checker for minecraft, but there is a big problem: The modders and online database that I´m using for update checks has no standard software versions e.g.: Local: ...
2
votes
1answer
72 views

If the UI layer depends on the Application layer. Who starts the application/process?

This is related to DDD for a desktop application in c#...with 4 layers ui/application/domain/infrastructure. Actually 3 desktop applications sharing part of the domain and part of the infrastructure. ...
0
votes
1answer
126 views

Solution for multiple versions of one Software

I'm sorry if the title is a little hard to get. I've never built an entire big software my self, just some small apps in my free time, i was more familiar with the do-what-my-boss-told-me things. ...
0
votes
0answers
19 views

Recommended reading for using C++ CLI for interops only [on hold]

I am going to use C++ CLI to call a native code into my C# .Net application. I picked up a book on C++ CLI, but it feels like too much information, since the book teaches you programming in C++ CLI, ...
2
votes
2answers
163 views

Best patterns for variable-scope disposables

I have Client which uses a disposable Connection for talking to a remote service. A Connection is somewhat expensive to set up and needs to be Dispose()d properly. I want to allow multiple methods ...
0
votes
2answers
229 views

Confusion in my If Else ,Else If Condition. in C# [on hold]

I have three column as follows: Month Tech Circle According to this column I need to fetch the data. In Month Column, Data is : Jan,feb, March... and so on. In Tech Column, Data is : Gsmnqi, ...
0
votes
1answer
33 views

Organizing solution / project structure and classes for Line of Business Application (LOB)

The question how-do-you-organize-your-projects already has a few good answers. I would like to get a better understanding about this suggested structure: MyApp.Core MyApp.Model MyApp.Presenter ...
0
votes
0answers
28 views

TryUpdateModel vs Parameter and ModelState.IsValid

As I was originally learning about MVC, the book I was using taught the following technique for Controller actions: public ActionResult MethodName(Model model) { if (ModelState.IsValid) { } ...
1
vote
2answers
202 views

Do immutable objects that constantly change impact memory/performance?

I'm writing a program that goes into a loop and keeps changing the state of some models (similar to a game). Naturally, many things are mutable. However, I'm also writing some classes that are ...
0
votes
0answers
9 views

filling dependency drop down list [closed]

I want to call the drop down list event selectedindexchange to fill the dependent drop down. inside the fucntion and then calling that function under button click. but its not working follow is my ...
-1
votes
0answers
20 views

how to send automaticaly email from asp.net web application using scheduled task [closed]

i am totally new with scheduled task, even i have never used it i just heared about this option from my friend then i post a question here. I have web application in asp.net c# using visual studio ...
1
vote
2answers
107 views

MVC/P in Desktop Application

I am developping a desktop application in C#, and have separated different layers in an MVC-ish architecture. As I have switched from GTK# to XWT, only views had to be adjusted, so the seperation of ...
0
votes
1answer
85 views

What design pattern should I use for import, update, export

I need to create a simple payments validator. On the following class diagram, I tried to present the model of payments. As you can see, each payment type inherits from Payments class. Now I want ...
1
vote
1answer
145 views

Are the over-usage of delegates a bad thing?

Good day. I have been told that a good practice for writing methods is to make the method only responsible for doing one thing. It made sense to me now that I look back upon it in retrospect. There ...
0
votes
0answers
37 views

Which one cross-platform or platform dependent [closed]

This is hard and also popular question, and I know that there is no strict answer for it, but I need your advise from your previous experiences. I'm asked to build a new software and it is for a ...
1
vote
2answers
122 views

Sanity check for design pattern used with an intricate calculation model

I am working on a project that generates technical brochures in batch. The 3rd party API that is being used expects POCOs with property names that match field names used in each of the brochure ...
2
votes
2answers
105 views

Wrapping constructor arguments

Given a base class with around 25 or so subclasses, I have found that adding an argument to the base constructor is painful. protected AbstractController(Service1 s1, Service2 s2, Service3 s3){ ... } ...
0
votes
0answers
53 views

What is the best way to learn COM programming? [closed]

I want to learn COM programming. I searched Google and nothing concrete is found, may be because I was searching in C# language. I don't know C++, but how do I learn COM using C#, MSDN pages are ...
-1
votes
0answers
81 views

Try another programming language or keep working with the same [closed]

Assuming that you are switching between eqal platforms with the same programming paradigm (in my case Java and .NET). Is it good for professional growth try to change language and stack of ...
0
votes
0answers
10 views

Send users google oauth authentication to soap WCF Datalayer [migrated]

I have today a WPF application that, for sake of simplicity here, manages a few appointments, and when ready sends the appointments to a WCF datalayer for integration into a 3rd party calendar system. ...
0
votes
2answers
149 views

What is a class library? [closed]

I'm working on a lawsuit and I need a definition of a 'class library' that I can reference. Every book and all the documentation I can find seems to assume the reader already knows what a library is. ...
2
votes
2answers
121 views

Property or Method to obtain information about a collection?

Suppose I have a MyList class which extends ObservableCollection<MyObject> where MyObject has the Boolean Property Enabled. Let's say I want the number of MyObject objects that have the ...
1
vote
2answers
89 views

Setting fields with correct default value

When writing constructors, I regularly encounter a situation where some fields already have approperiate (default) values, such as false for boolean values and 0 for integers. What are reasons to ...
-1
votes
0answers
89 views

Proprietary languages [closed]

A company that I work for have a valued reason for adopting a proprietary language, which is highly efficient in the work that they do, moreso over other mainstream languages. I was told that syntax ...
0
votes
0answers
39 views

How to write an Excel workbook to a MemoryStream in .NET without first saving it to the file system? [migrated]

All options within the Microsoft.Office.Interop.Excel.WorkBook save options take a filename. And not sure how to use Microsoft.Office.Tools.Excel.WorkBook. I have also found another query here which ...
0
votes
2answers
94 views

In Asp.net, how browser knows a textbox is registered with server side TextChanged event?

When I evaluate asp.net control events, I am not able to identify how the browser is aware of asp.net textbox is subscribed to serverside textchanged event or not. When I look the server generated ...
1
vote
1answer
81 views

Linking to MIT-Licensed dll

I'm currently working on some closed-source proprietary software that makes use of a library (SharpAVI) distributed with the MIT License. The SharpAVI source isn't being used directly anywhere in my ...
0
votes
0answers
98 views

Why Doesn't SMTP Mail Attachment Dispose When Client Does? [migrated]

This is an issue that I recently solved, but was wondering if somebody could help clear this up for me since I don't fully understand what exactly happened. I created a simple smtp email client and ...
1
vote
3answers
242 views

Trying to come up with a mapping convention for C# objects

so this is C# but it could apply to any OO language where different sets of objects exist across different layers of an application. We have been trying to come up with a convention within the team ...
0
votes
2answers
220 views

how to approach pharmacy software project [closed]

I would like to complete a pharmacy software proof concept. But I have a few questions I do not know. Physician information In order to refill or dispense a new RX the software needs to have access ...
-1
votes
1answer
60 views

converting WKT to GeoJSON [closed]

I am working on a library to convert Well Known Text into geoJson. For converting WKT representation of a multiPolygon would it be best to find polygons with a regular expression or by parsing the ...
3
votes
2answers
124 views

How are composite tables generally handled when there is no ORM tool available?

I am developing a Windows Runtime Component (C#) to be used in an HTML/JS frontend for a Windows Store App. Now, one of the requests is to have a database on the local system to store metadata about ...
4
votes
5answers
1k views

Is this a good practice or not?

I have a colleague who has come up with a way of 'genericizing' information from a database so that all his web application's drop-down lists can share the same object in his MVC.NET C# code and ...
0
votes
2answers
105 views

How to deal with a new version of visual studio's directory?

When upgrading Visual Studio to a newer version, a new directory is created e.g. "Visual Studio 2013". I understand that that makes sense as we want to differentiate between code targeting different ...
6
votes
2answers
194 views

Is it good practice declare a function inline?

I'm writing a method and depending on a config field I need to change where I get my data from. What this results in me having to write code that looks like this: List<string> result = new ...
0
votes
0answers
37 views

Can sequence alignment algorithms be used for search implementation?

Hi I want to implement a search on a website which includes imperfect search results. Meaning, if the search term is misspelled or slightly different from a 100% match, the function should still ...
1
vote
0answers
59 views

Managing debug information of C program for Debugger

I am not sure if the title is appropriate. I have written a parser for CDB files in C# and ANTLR that creates runtime objects for me such that I can pass it to the TCF Agent which takes care of ...
0
votes
1answer
107 views

Coding shortcuts for type conversions or similar [closed]

bool? example = null; is actually Nullable<System.Boolean> example = null; Now for the bool to System.Boolean conversion or actually compile-time replacement: We ususally hardly care, as it ...
0
votes
1answer
91 views

Confused on how to properly employ a Repository Pattern with Service/Business Layer on top

I'm building a ASP.NET Web Api 2 solution for learning purposes, and I've hit a snag. I was wondering if anyone could tell me what exactly it is that I'm missing. My Web Api solution has 4 Layers: ...
0
votes
1answer
56 views

Full signed part of two complement long [closed]

I am reverse engineering a data file (from a synthesizer). It seems that e.g. -1 is written as FF FF FF FF, so in four bytes. while +1 is written as 00 00 01 (--), so only three bytes. Is something ...
4
votes
0answers
163 views

How to best implement K-nearest neighbours in C# for large number of dimensions?

I'm implementing the K-nearest neighbours classification algorithm in C# for a training and testing set of about 20,000 samples and 25 dimensions. There are only two classes, represented by '0' and ...