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
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
247 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
224 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
61 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
130 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
195 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
96 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
183 views

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

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 ...
0
votes
0answers
11 views

Dynamic Data won't display calculated fields; ASP.NET 4.5, Entity Framework 5.0 [migrated]

I'm trying to display calculated fields in my Dynamic Data Entities site. I have generated my EDMX file from an existing database, and have added customizations in a separate file using partial ...
0
votes
0answers
41 views

Better approach to online builder [migrated]

I have a windows forms application which needs customized dll files to be built and for that I am using an online builder using asp.net. I am in no way a asp.net expert not even near a beginner but ...
-1
votes
1answer
60 views

System and Application Monitoring Idea [closed]

I am attempting to write a monitoring service of some variety using C# that will provide information about the server the service is running on. This information will be system process information, ...
1
vote
3answers
120 views

Commenting strategies in C# & asp.net web api

I've been working on a ASP.NET Web Api 2 project as a learning exercise, and I was wondering what the norm regarding commenting is. I use the Repository / Service Pattern, and everything is very much ...
0
votes
0answers
4 views

How to inject a .net Provider (OAuthAuthorizationServerProvider)? [migrated]

I'm looking for a solution how to inject IApplicationUserManager into a OAuthAuthorizationServerProvider.cs This is the sample I'm looking at now: ...
0
votes
0answers
64 views

Scope of serialization [migrated]

3 classes organizationalUnit workFile workItem They're in some sort of Pyramid pattern: 1. Contains one or more of 2. 2. Contains multiple of 3. Each contains a reference to their "container": All ...
3
votes
3answers
364 views

Why shouldn't an object reference have access to a static member in C#

Context of my question: I am reading C#. Trying to understand Static keyword. I understand that when Static is applied to a member of a class, it can only be modified by the class and not the class ...
-3
votes
0answers
17 views

How Can I Show Up A Search Result In A Textbox? [migrated]

I’ve created a table Code and would like to search and retrieve an answer introducing device Imei in textbox imei und when I click on the search want display the result(code_mck)in textbox code i want ...
2
votes
1answer
125 views

Is serialization better done in instance methods or static methods

Say I have a class workStockItem, that I wish to serialize. Which is the better style? using a static method or using a non-static method (maybe even implemented as a property as seen below) ...
1
vote
1answer
78 views

Implement Generic DataSet Builder with C#

I want to create a data access library that can build a DataSets with relations which can easily be written to XML with dataset.WriteXML(). This is a get to know C# endeavor that will hopefully gain ...
4
votes
3answers
148 views

Is it a good idea to return a default value if a field in a query cannot be found?

At the place I work we are using a SafeReader class that wraps an IDataReader. One of the 'features' is that if the field you are trying to access wasn't in the query then it just returns a default ...
3
votes
2answers
673 views

Why does C# have much more features than Java? [closed]

Please note that this isn't meant to be a Java vs. C# argument. I'm a Java programmer with no C# experience, asking just out of curiosity. I did some reading on C#, and it seems it has much more ...
1
vote
0answers
116 views

How to backup data and images in this project?

I have MS C# and MS SQL 2008 database project. It can capture employees' records with pictures of more than 1000 records. Presently, I'm able to capture say 150 records on PC1 using my installed C# ...
6
votes
2answers
159 views

Why does F# Core define generic array types?

I just noticed that the FSharp.Core namespace includes generic array types of up to 4 dimensions, i.e. Core.[]<'T>, Core.[,]<'T>, etc. C# and VB seem to be doing just fine with System.Array - ...
1
vote
2answers
157 views

When to use [Pure] on a constructor?

I'm learning about code contracts in .NET, and I'm trying to understand the idea of pure constructors. The code contracts documentation states: All methods that are called within a contract must ...
0
votes
2answers
84 views

Alternative to Static Abstract Property/Method

Since trying to use them will cause an error what is the workaround to get the same effect as them? My Base Class: public abstract class IPacket { public abstract int Identifier { get; set; } ...
1
vote
3answers
103 views

Passing two different types down a chain of calls because of an overload further down

I've got myself into a bit of a mess. I've got code coming from Main, through myMethod and down to OtherMethod. One of the parameters can be either an int or a string, which affects OtherMethod but ...
0
votes
2answers
224 views

using this in a constructor, why does it work?

I got two classes. busiObj(created from ancient flat files) key(provides means to tell busiObjs apart) key has a c'tor that takes a busiObj public key(busiObj foo) { bar = foo.someThing; ...
2
votes
4answers
1k views

Going through The C Programming Language K&R in Visual Studio

From what I have read, K&R seems to be a good place to start learning programming in general, and C programming specifically. However, I've just started the first chapter and I have a few ...
1
vote
2answers
93 views

Scalable Job Handler

We have a job table that triggers a notification when a new job gets inserted. Clients that can handle such jobs may subscribe to those notifications. When a client receives a notification, he can ...
0
votes
2answers
54 views

Maintaining sequence number for the day while creating file from windows service

I have a windows service which invokes a dll periodically and creates files. The file names should be in sequence. Example files will be myfile1.txt, myfile2.txt....mfilen.txt. The number will ...
-2
votes
0answers
23 views

C# Stackexchange Questions API [migrated]

I need to build an web application and below is what i'm stuck with Can I use StackExchangeAPI's with Key? do they have a "hello world" key can be used for learning purpose. I wish to get the count ...
1
vote
0answers
33 views

Is it improper to have an application wide source for dropdown binding

The WPF Combobox needs to bind a collection to it's ItemsSource and something to bind the selected item or value to. Until now, I've included both the collection and the selected value properties that ...
1
vote
0answers
67 views

Having trouble with exposing class properties across projects

I have several projects in my solution: Logan.Web.DBContext defines the DbContext for the database and builds the data model Logan.Web.Objects defines the classes that will represent the tables in ...
-1
votes
1answer
111 views

Approach to cover all the cases in Unit Tests [duplicate]

I am new to Unit Testing and i am able to write them but my problem is I am not sure that I have covered everything in Unit Tests. What could be the approach for testing some functionality in a code?
1
vote
1answer
137 views

Architecture of large-scale API (User Management)

We are currently designing an API that will hide different services (Product, Content, User etc) that will be used by our own website, our own apps etc. It is not a public API. We are looking into ...
0
votes
1answer
100 views

Entity Framework 6 Conventions

I use the Entity Framework often, but I have one area of confusion I would like to understand better. If I wanted to have a navigation property in an Entity such as public virtual ExampleObject ...
0
votes
2answers
163 views

How to structure REST api service that accepts POST parameters in the body

Everything I've read says to pass parameters to a REST service in the URI, whether by template, or query string: https://www.myapp/my/login/api/authenticate/ganders/mypassword or ...
2
votes
1answer
198 views

C# server side application 100 GB dataset + Garbage Collection

If I have server with 256 Gb of ram. I was wondering can I create a C# application which has a 100 GB of memory footprint? I want to create a dictionary like ...
2
votes
2answers
250 views

Project based prefix for class names

My project leader uses project based prefixes for class names, lets say projects name ABC, he create User class name as ABCUser. and he says he do this becasuse if he wants to make User.aspx Users get ...
0
votes
2answers
109 views

Is there a downside to using AggressiveInlining on simple properties?

I bet I could answer that myself if I knew more about tools to analyze how C#/JIT behaves but since I don't, please bear with me asking. I have simple code like this : private SqlMetaData[] ...
1
vote
2answers
170 views

Best way of storing a small number of user credentials

I'm working on a messaging application, based on a server/client architecture. Now I am thinking about the way how to store the user credentials. It's not a huge number, just about 20 entries with ...
1
vote
2answers
197 views

Retrying a statement or call in a catch block - code smell or anti-pattern?

I'm wondering how better to perform this operation for a large amount of files. The bit I'd like some thoughts on whether this copy/paste is acceptable enough of a tradeoff. try to write a file if ...
0
votes
1answer
82 views

Full Text Indexing Strategy for MS Excel Documents

Background As part of a broader application that allows users to search thousands of MS Office documents on a private network, I need to index and make searchable Microsoft Excel files. My basic ...
0
votes
2answers
246 views

What is a typical team size for a complex half million lines-of-code C# desktop application? [closed]

Imagine the following scenario: Codebase of 600,000 lines of code (C#) All in a single desktop application All written by a single developer (myself) over 8 years (3 years worth of actual coding ...
3
votes
1answer
54 views

Pattern to use to relate multiple data sources to different user data widgets

I have an client x server intranet application the basically gets data from the server, format it and send that data to the client for display. At the server we are using ASP.NET C# running on IIS ...