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

2
votes
2answers
49 views

Integration testing and database connection string in app.config

I am working on a project where SqlConnection is created via a static method, lets say it's DatabaseAccess.GetSqlConnection(). This method reads the .config file to get the connection string and ...
-3
votes
0answers
35 views

Dropdown search function in WPF/C#? [on hold]

Is there anyway to implement dropdown (Combo box) search function in WPF/C# ? I want to implement search function similar to facebook. When I type a word or sentence similar records should appear in ...
1
vote
2answers
72 views

C# Subject Observer Architecture question

I'm making a C# application using the Subject Observer design pattern in a slightly different way. I am passing the Provider Class, implementing IObservable (this has the OnNext() method that ...
-6
votes
0answers
24 views

Get info to your site from another site [on hold]

can anyone help me to find a way to get UserKey from TrueCaller ! And.. How can i build a code in C#,to get informations from another site An exampel.. i need to get info about a certain phonenumber ...
0
votes
1answer
75 views

Should I initialize a member variable in declaration when it is initialized by a constructor parameter?

Which is recommended for initialization of class fields in C#: class Foo { public X x = new X(); // or any default value... public Foo(X _x) { x = _x; } } Or class Foo { ...
-2
votes
0answers
211 views

I'm really terrible programmer. please help [on hold]

I'm doing my 3rd year in BSc Software Engineering. I managed to pass all the exams but. I'm really a terrible programmer. I want to learn everything about programming concepts. but don't know where to ...
1
vote
4answers
128 views

When to make a method part of an interface or a concrete implementation?

I create an interface for database access to a MySQL database. Currently, this is the only way to access day, but to make it easier to test and in the event that the data access might change, I used ...
-2
votes
0answers
25 views

How to code a Data Scrapper [on hold]

I’m a javaScript beginner. For a practice project, I want to create a Page Scraper that will list of all classical musicians, (say from classicalmusic.com), and then have that data returned in a ...
0
votes
1answer
44 views

Any good data structure to perform efficient lookup and modification operations about what are the shapes containing the current cursor position

I think I'm facing a pretty common issue but cannot remember which solution is the most suitable one. Let's put it that way: I can, in a, certain, given, language get some events anytime the user is ...
1
vote
2answers
74 views

Is storing data that rarely changes in-memory a good candidate for a singleton/cache?

I have a class called DataPoint that is defined like the following. Currently, it goes through each property on an object and based on the DataPoint, it does some formatting like padding, trimming, ...
-1
votes
0answers
15 views

WebAPI to source Location Satellite Images [on hold]

I am developing an ASP.NET web application that calculates a percent score of an algal bloom from a satellite image. I'm looking for a WebAPI that will allow me to access a recent satellite image ...
0
votes
0answers
72 views

To KISS or not when coding? [duplicate]

I don't consider myself "ninja" but I don't think I'm bad dev either. Anyway, after many years of development I tend to keep it simple more ofthen than before. For small projects there is no need to ...
0
votes
0answers
14 views

Is the ProtectedData class still an acceptable method to store passwords? [migrated]

I'm writing a piece of software which will have to store a users password to allow authentication with a 3rd Party service. Unfortunately, this service currently requires the use of a password rather ...
2
votes
1answer
171 views

When designing a data structure, should I implement very inefficient operations for convenience?

(I've added the .NET tags because the data structures are for .NET, and this question should be considered in the context of the conventions for that platform.) I'm writing a library of immutable and ...
0
votes
1answer
51 views

Create a Winforms Flowchart Control when performance matters: Set of controls / Handle everything manually (painting, user interactions, etc.) [on hold]

I am currently trying to create a Flowchart / Diagram Control (e.g. NShape) and I am struggling about what to use to manage the primitives (rectangle, rounded rectangle, square, circle, arrows, etc) ...
2
votes
2answers
129 views

Abstract classes and constants

I have two classes that share a lot of code and are conceptually variations on a common class. So I want an abstract class that contains all their common code and then they can each inherit from it ...
3
votes
1answer
98 views

Better to write your .NET library with COM limitations in mind, or separate your .NET library from Interop?

I came across this interesting article: How I Came to Love COM Interoperability on CodeProject, which got me thinking... The author argues that they do not want any COM-ities in their .NET library ...
-5
votes
0answers
81 views

What are the basics of software engeneering [closed]

I want to be a software engineer what is the process where to start I want everything to be online.
1
vote
0answers
165 views

What architecture is suitable for players matchmaking?

The system should match players to game rooms. When the room is ready it moves to a game server. Each game start request can have a list of prefered game servers and specifies exactly game mode ...
-3
votes
0answers
26 views

Should one devote efforts to learning C# in lieu of VBA, for practical purposes in Excel? [closed]

I am a data analyst by trade and have background in RDBS, sql, ms server and excel is an everyday tool as well. I have OOP background (Java, python) but have never approached any .NET. Heard from a ...
-2
votes
2answers
91 views

Null object pattern or nullable [duplicate]

What's better for implementing null object pattern: 1) provide special state for instance or 2) use everywhere ? (Nullable) operator? And I'm thinking about structs only.
1
vote
0answers
21 views

Calling Async method in class constructor in C# [migrated]

Currently I'm developing an universal app using c#. In app I used sqlite as database and as you may now It has async methods. I have a class with some null property that I'll fill them using data I ...
2
votes
1answer
101 views

How do you separate view from logic in a Winform application?

I know there are patterns like MVC to separate view from logic, however, I don't know how common they are in Winform applications. For a C# Winform application, I may start with a Form and gradually ...
-4
votes
0answers
81 views

Does C# meet my all of my needs? [closed]

TL;DR: Are there any serious issues with using C# over Java for mobile dev and would I be more likely to find jobs in game development with C++ or C#? -- At the moment I'm familiar with HTML, CSS, ...
-2
votes
0answers
17 views

Where can I find the contents of FibreConnList? [migrated]

Given a block of code, if (messageType == typeof(FibreConnectorClass)) { FibreConnectorClass fibreconnect = (FibreConnectorClass)payload; fiberConnectorComboBox.Items.Clear(); foreach ...
2
votes
2answers
94 views

For a concrete SQL Repository, should I encapsulate the SQL logic inside or outside the repository methods?

If I have a concrete repository based on SQL data access, should I pass in SQL to the repository methods or encapsulate them within the methods. I feel if I pass them in, then I am coupling my ...
-2
votes
1answer
71 views

How can I add more classes in C# Windows Forms project? [closed]

When you program in Java, you have a package, and in that package you put class files, where you write your logic, you have one main file, and you spread your code in the rest of the classes, for ...
1
vote
1answer
149 views

What is better repository design?

I have tables that I insert, delete and update, but I read from views. At times, I may read from the tables as well. What is a better generic interface for a Repository: public interface ...
0
votes
1answer
54 views

How can I refactor this c# repository code? [closed]

I have a couple questions on how to create my repository classes. I will give an example of the type of data that I am working with. I am considering using Dapper or PetaPoco, but that shouldn't ...
-1
votes
0answers
10 views

C# dataGridView image column link to file [migrated]

I am working with an image column on dataGridView: As shown in the attached picture, when I click on 'browse' I can choose a file from the dialog window. What I want... is to make the image on the ...
1
vote
5answers
83 views

How much data from a web service should I expose in a library?

I'm working on a personal project, a library that can access the weather forecasts and other weather related data from it. However, a lot of the returned data is sometimes quite redundant or simply ...
1
vote
2answers
108 views

Asp.net caching strategy/pattern

In my WebApi controller I have the following (pseudo) code that receives update notifications from Instagrams real-time API: [HttpPost] public void Post(InstagramUpdate instagramUpdate) { var ...
0
votes
0answers
59 views

What is the design pattern name for a class that handles 2nd level caching? [duplicate]

I have a system where I want to start introducing some 2nd level caching. I want to abstract data access a bit and allow some type of other class to do the dirty work of fetching a DTO; it will check ...
1
vote
1answer
96 views

How to handle custom logic for multiple customers

We got a project where we have to process certain requests which the customer sends. The request is either in a generic format or in a customer format (all xml) which is then converted to the generic ...
-1
votes
0answers
14 views

Task based timeout, activating slower than expected

I have an HttpMessage, which at some point expects a result. I want the user to be able to await a task which returns ether after the response has been set, or after the timeout has elapsed. When ...
1
vote
1answer
120 views

C# Structs, 16 byte rec. - Are getters and setters included in that?

I was reading into the nitty-gritty of structs in C# here: "C Fundamentals, The differences between struct and class." and at the very bottom it mentions keeping a struct below 16 bytes. I looked ...
0
votes
0answers
8 views

Is there any way to create an implicitly typed global variable in C#? [migrated]

if (i==101) { var lastLoopCheck; } Visual Studio 2013 displays an error:- "Implicitly-typed local variables must be initialized". Which leads to the assumption that implicitly ...
3
votes
4answers
180 views

Filling the gap between Conception and Unit Test

I am stuck trying to do TDD. I'd rather seek the counsel of others who have gone before rather than waste time with trial and error. QUESTION: What diagrams / exercises / development processes can ...
1
vote
0answers
14 views

Interactively reading from and writing to command line with UI application [migrated]

I have UI app that calls cmd periodically with different arguments and I want to periodically update UI with cmd output results. Here's the code I use, but the problem is that UI is updated only when ...
0
votes
0answers
132 views

Dependency Injection with EF - is mapping required?

I'm implementing the Repository pattern with using DI and EF6. I created the database (that inherits from DbContext) object with the Visual Studio wizard ADO.NET Entity Data Model I have a generic ...
-2
votes
0answers
34 views

Function of AutoWire = “Constructor” [closed]

I try to inject the transaction interceptor to the contructor. This, using the TransactionAttributeSourceAdvisor. I need to know whats is the function of the Autowire = "constructor" using this bean ...
0
votes
2answers
102 views

Security scheme that prevents duplicate message attacks

I am using custom security scheme to verify communication between client and server. Both client and server have same secret hash phrase. Client builds a message, combines it with hash phrase and ...
0
votes
1answer
86 views

Lucene vs Solr - Indexing pdf/word documents reisiding on a NAS drive using .Net [closed]

Using ASP.Net, I want to implement full text search using Lucene/Solr on a LARGE number of docs (word, pdf etc.) residing in a directory on a NAS drive. The NAS drive would be mapped as a network ...
3
votes
2answers
66 views

Why aren't field-like events implemented as a list of delegates?

tl;dr: Why are field-like events implemented as a single delegate field? Wouldn't it be more straight-forward to use a list of delegates, thereby eliminating the null special case and avoiding all the ...
1
vote
3answers
280 views

Use interface or abstract class?

Now the title might seem like the question has been asked before but let me explain my situation and you'll see why I am asking this question. Let's consider this interface : public interface ...
0
votes
1answer
48 views

How to create good positive and negative images for opencv to distinguish smiling from not smiling? [closed]

My goal is to create an opencv haar classifier xml that distinguishes between me smiling and not smiling. I created images, cut them, showing me smiling and as negatives not smiling. About 5000 ...
-1
votes
1answer
89 views

How to selecting Teams with Minimum Difference between Knowledge Levels

For the below challenge from a programming site, I am bit confused. Problem Statement: A Professor of Physics gave projects to the students of his class. The students have to form a team of two for ...
0
votes
1answer
140 views

Most efficient LINQ result for Contains() query

I currently use the following: var result = list.Union(otherList).SelectMany(l => l.children).ToList() foreach(var child in lotsOfChildren){ something = result.Contains(child) } I only use ...
1
vote
0answers
134 views

How to Use Python as a “Macro” runner for a C# Application

I am working on an application that the user may wish to automate some features of (but we don't know what at the moment) I would like to provide them some kind of scripting interface so they can play ...
1
vote
1answer
120 views

Decorater pattern or strategy pattern

I'm constructing a c# serverside application and I'm trying to do this in a way it can easily be maintained aswell as extended if needed. So what we have is 4 different requests that need to be done ...