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

Appointment Handling in ASP.net C#

I'm planning to develop an dental clinic patient information with billing system and appointment handling system for our thesis. I just want to ask if you know some plugins that might be useful that I ...
1
vote
2answers
91 views

User and role modeling

I'm working with a system in ASP.NET MVC, with Entity Framework for ORM. The application has a requirements to allow users to have different types of roles, and authorization rules will be different ...
1
vote
1answer
219 views

Clarification about Event Producer in StreamInsight

I need a small clarification about StreamInsight, I know by doc's that StreamInsight can handle multiple concurrent Events. But will the event producer be a separate function, for ex: I need to watch ...
-3
votes
0answers
53 views

What is an equivalent expression of (uint)((long)hash * 33 ^ c) in vb.net [on hold]

I am having C# expression (uint)((long)hash * 33 ^ c); and converted into vb.net using http://converter.telerik.com/ and I got the expression like CUInt(CLng(hash) * 33 Xor c). It throwing an ...
-1
votes
0answers
44 views

Line wrap conditional/ternary operator (?:) at end of line or beginning? [on hold]

Which is more intention revealing? var username = (context.Controller as BaseController).LoggedInUser != null ? (context.Controller as BaseController).LoggedInUser.Name.ToString() : ...
2
votes
1answer
124 views

Is it good practice to put database connections into a class library? [on hold]

I am using entity framework and I created multiple libs. XYZ is main lib which handles majority of operations. And for integration purpose I have created different libs which are comparatively ...
1
vote
1answer
52 views

What should the files and folder (Core, Assets, Common, Models, Resources, Views) in my project represent?

I am a novice programmer who has inherited a software project that contains the following files and folders. The project is using C# and WPF. What should I expect to find and continue putting inside ...
0
votes
1answer
101 views

Best approach to write windows service

We got a situation where we need to write a windows service using c#, the service need to be install on a particular -single- server. Also service need to communicate with a DB to access certain table ...
4
votes
4answers
209 views

Is guaranteeing immutability a justification for exposing a field instead of a property?

The general guidance for C# is to always use a property over a public field. This makes sense- by exposing a field, you're exposing a lot of implementation detail. With a property, you encapsulate ...
-5
votes
0answers
48 views

improve skill to higher and higher levels [on hold]

i have finished several tutorials and online courses for tags programming language. but recently when i go to any interview they asks me about previous and since i am beginner i just had small task ...
8
votes
3answers
486 views

Cleanest way to write logically procedural software in an OO language

I'm an electrical engineer and I don't know what the hell I'm doing. Please save the future maintainers of my code. Recently I've been working on a number of smaller programs (in C#) whose ...
0
votes
1answer
256 views

A CLR SQL Server Stored Procedure calling an ASP.NET Web API

We are developing a big system with SQL Server database, ASP.NET Web API 2.2 services and another external services. We need to load more data on a table while we process the current data on it. To ...
2
votes
1answer
40 views

Implementing a series of independent Actions that are disparate but with common accessibility

I have a requirement to implement a type of AI for a project, the issue is that I am having trouble visualizing how the AI should actually be implemented. Essentially, I want the AI to be as dynamic ...
1
vote
3answers
79 views

Using delegates to avoid duplicate creation of resources

I'm writing a PCL that uses an HttpClient to go visit a few sites and extract data from them. My initial code looked like this: public static class Download { public async static ...
2
votes
2answers
473 views

Understanding C# Delegates Structure

I've been trying to understand C# delegates using Pro C# 5. In short, the author describes the motivation for delegates as a structured way of dealing with function pointers and callbacks or two-way ...
4
votes
2answers
120 views

Should serialization and deserialization be the responsibility of the class being serialized?

I'm currently in the (re)design phase of several model classes of a C# .NET application. (Model as in M of MVC). The model classes already have plenty of well-designed data, behaviors, and ...
0
votes
1answer
37 views

Step-by-step functional testing automation

I have a basic class in C# from which I create inherited classes for databinding scenarios. You can think of it as a substitute for .NET's DataRow class. I want to automate testing of a typical row's ...
1
vote
2answers
379 views

Generics in C# Test Class

I'm learning about unit testing in C#. Languages_Service and PlaceOfWork_Service are classes for SOAP services which Microsoft Navision generated for me. There are several methods that are very ...
13
votes
3answers
997 views

How are generics implemented?

This is the question from compiler internals perspective. I am interested in generics, not templates (C++), so I marked the question with C#. Not Java, because AFAIK the generics in both languages ...
9
votes
4answers
319 views

Reducing boilerplate in class that implements interfaces through composition

I have a class: A that is a composite of a number of smaller classes, B, Cand D. B, C, and D implement interfaces IB, IC, and ID respectively. Since A supports all the functionality of B, C and D, A ...
1
vote
1answer
122 views

C# intentionally flickering

i'm currently working on a project which must provide intentionally flickering of some part of UI (white rectangle which must change color to black). That changing of color must be done at some ...
0
votes
0answers
21 views

Using REST to get/post/etc polymorphic types stored in Table-per-Type database

I've got a Table-per-Type database something similar to this: public abstract class WorkItem { public int WorkItemId {get;set;} } public sealed class CancelingWorkItem : WorkItem { public ...
-1
votes
0answers
38 views

Active Directory Users + CRUD operations + Web Application + c# [on hold]

I would like to make web application that is available only for domain users inside my company. What I need for now is to create a page that allow CRUD operations on AD users - It could be a ...
3
votes
1answer
303 views

Separation of concerns between repository and service in DDD with complex entities

This probably seems as an example of opinion-based question, but I'm actually looking for rationale on how to decide correctly, I believe there is a correct solution that can be backed by solid ...
-3
votes
0answers
15 views

ASP.NET MVC Display dbo.webpage_Membership table

Im using the already built Account model in MVC 4 and Im trying to display dbo.webpage_Membership table on my page. I managed to do that with UserProfile class and display UserId and UserName. ...
1
vote
5answers
243 views

Tricky architecture in C# involving a symmetric operation and a viewing class

I'm trying to build an architecture in C#, and I can't figure out a way to accomplish the task. Basically, there's a set of classes A, B, C and D that inherit from I. Each of these classes has an ...
-6
votes
0answers
36 views

Make a gui for the windows command line function junction point [closed]

I want to make a GUI for command line function junction point basically for this command mklink /j D:\Docs E:\Users\Kari\Documents SO instead of going to command line and typing the DIR's the ...
-3
votes
0answers
42 views

How to programmatically (C#) add/modify firewall rule on windows 7 and newer [on hold]

I am writing application, where is need add rule to windows firewall when application start and remove/disable when is closing. How make it in C#? Thanks for reply.
3
votes
1answer
81 views

Creating an interface just to decouple from third party libraries

I'm currently developing the Authorization module on a framework of mine. I have the following class so far: public interface IAuthorizationManager<C> where C : ...
0
votes
2answers
311 views

Loops to create nested loops

Is there a way to use a loop to create more nested loops? E.g. Doing this for (int i = 0; i < iterations; i++) { //Do stuff for (int ii = 0; ii < ...
0
votes
0answers
69 views

Using static Create() methods with delegates in abstract base classes in C#

I am attempting to write an extensible graphing calculator program, in which individual components can be extended or replaced as needed without changing other components. I create a DLL containing ...
2
votes
0answers
139 views

How does one cycle back to previous options in a C# console application? [migrated]

To say I'm fresh off the boat would be an understatement. I think this solution is extremely simple for an experienced programmer, but I'm completely new to C# and coding in general, so I apologize if ...
0
votes
1answer
21 views

How to trace an image/char on mobile device using c# and/or xamarin [closed]

If I had an image outline (or font character outline), how would I go about calculating the accuracy of somebody tracing that image. I was thinking that I could get the RGB components of the person's ...
-1
votes
0answers
45 views

Question to better the understanding of how Async and Tasks<> work [closed]

I wrote this program, it compiles and runs appropriately. However, There are a few things I would like clarified as I am still learning about Asynchronous Programming. Comments in the code on where I ...
2
votes
1answer
804 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
29 views

Class to manage EEProm Memory for microcontroller in .netMF

I've got a working driver to access the EEPROM chip, but looking for much better management and access of the memory. I've been racking my brain about what's the best or correct approach to do this. ...
5
votes
0answers
207 views

Passing Anonymous Type to a Bound Control

Generally speaking, I'm fairly opposed to the use of anonymous types in real-world code (except in LINQ and some other specific scenarios), but I'm looking right now at a situation where I need to ...
4
votes
1answer
333 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 ...
3
votes
1answer
133 views

Design: .NET web app architecture problem

I'm taking my first foray into .NET and I'm designing a web app that's heavy on other web services right now. I'm intending to do the following: Take user input (a USDOT number) Request data from a ...
1
vote
3answers
415 views

Bad Practice using Auto Generated Classes for Data Access

I've seen this before but haven't found concrete reasons. When you add Entities to your EF model, EF auto generates classes for these entities. In terms of DataAccess, why is it preferred to not ...
0
votes
1answer
75 views

Is N-Tier worth it when developing an ASP.NET application?

Let me start of by saying that by "worth it" I don't mean "remove DI and interfaces" and such. What I mean is to place the code in separate class libraries. Like done in the Onion architecture - ...
7
votes
4answers
256 views

Testing a Conversion class

I have a class that is responsible for performing conversions from/to twenty-something types. Let's call this class ConvertUtils. For C# programmers out there - this class expands .Net's Convert ...
3
votes
1answer
249 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 ...
1
vote
2answers
291 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 ...
5
votes
2answers
351 views

Generic Sorting of Lists<>

I have several Lists<> that holds objects of different classes. List<classA> listA; List<classB> listB; List<classC> listC; //... List<classM> listM; The classes do not ...
1
vote
2answers
78 views

Inheriting and storing objects that contain different types of other objects

To start off, this is more of a best-practice question than anything. Introduction to the Environment I have myself an abstract class. Let's call this class Item. I also have another abstract class, ...
-2
votes
0answers
82 views

Disk faster than Memory? [migrated]

So I have a file called "Numbers.txt" having 10 million lines each containing one digit number. I want to sort this file and store the results in another file. So I wrote 2 really hacky solutions. One ...
1
vote
1answer
114 views

Design Pattern - Adding features to a class

I'm finding myself unable to solve a design problem. For the sake of my simplicity, I'm going to use C# (Web API). Let's say I have an abstract class RestController: public abstract class ...
0
votes
1answer
56 views

Class with navigation property and with or without foreign key

Let's say I have the following classes, auto generated by Entity Framework, that have an association: public class Parent() { public int ParentID { get; set; } // PK public int ChildID { ...
2
votes
0answers
66 views

Async library guidance

I'm creating a library that contains a class that exposes several Async methods: public class MyClass { public async Task<Foo> DoFooAsync() { /*...*/ } public async Task<Bar> ...