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

-4
votes
0answers
33 views

WCF certification exam retirement [on hold]

Good day! Recently I decided to improve my WCF skills by passing MS 70-513 examination, but founded that the exam was scheduled to retire next year summer MS exams scheduled to retire Please, ...
0
votes
2answers
121 views

Is there a way to sort code properly into regions dividing methods and events?

I'm using ReSharper and CodeMaid, both have their own "organize" code option but the problem is that i have no idea how to tell them what is an event and what is a method/function that i coded. If i ...
3
votes
0answers
183 views

MVC: Where is the right place to set error messages?

I have a ASP.NET MVC application where in all my Models have an Errors Property used to store non-validation errors which I than display in my Views. Where is the right place to populate the error ...
-2
votes
1answer
39 views

Distinct Log and Trace for each object in .NET [on hold]

I am dealing with very complex objects in .NET (in my case a finite element model that can consist of thousands of other objects say a Model instance have a large list of Element instance). I would ...
-5
votes
0answers
26 views

Best books for learning .net programming and development [on hold]

Basic .net programming language concepts
-2
votes
0answers
36 views

Decode a text in c# [on hold]

I have a problem I want to decode a Text that I don't know the method of encryption, but I have some values of the letter such as "A" = "6B" and "a" = "4B" is possible to do reverse engineering to ...
0
votes
0answers
23 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 ...
2
votes
2answers
123 views

How do I write my BLL to make it re-usable?

Most of it was written 4-5 years ago. Our teams long term objectives are to use Entity Framework. Though we aren't gonna do it right away as our deadlines aren't allowing us to do so. Now we have our ...
0
votes
1answer
95 views

Is this instance of mixing FP and OOP a good design?

I had a strange-feeling pattern come up in some code I was writing. In a project with user accounts, there was a lot of code that needed to do common things such as creating accounts, deleting them, ...
6
votes
3answers
624 views

How to unit test code that downloads a file from a github repo

This is my solution's structure: Storage.csproj > FileDownloader.cs > GitHubProvider.cs (implements IStorageProvider) > IStorageProvider.cs Storage.Test.csproj > ...
9
votes
3answers
298 views

I get dependency injection, but can someone help me understand the need for an IoC container?

I apologize if this seems like yet another repeat of the question, but every time I find an article regarding the topic, it mostly just talks about what DI is. So, I get DI, but I'm trying to ...
-4
votes
0answers
36 views

VS or ReSharper shortcut for collapsing properties to one line? [on hold]

I often find myself collapsing properties written like this: public int A { get { return this.B + this.C; // or some other simple expression } } To something like this: public ...
0
votes
1answer
59 views

LDAP users synchronization [on hold]

I'm looking for a way to synchronize a users database between a piece of software and a ldap directory. Currently I'm thinking of three possibilities to keep the track of a specific user : Guid : it ...
-3
votes
0answers
56 views

Want to add Another loop in while Condition [closed]

I am having difficulty in writing code public void Func(string[] Abc) { string value=GetValue(); While(any string in Abc[] contains value) { value=GetValue(); } } the ...
1
vote
4answers
287 views

When to not use dynamic in C# [on hold]

I'm making a class similar to the following: public class KeyValue { public readonly string key; public readonly object value; } Value could be of any object type as a result of this ...
1
vote
2answers
142 views

Where to put database table/column names?

I'm making a web app that will be querying an existing database. I'm thinking of putting the names of the tables and columns and such into a single static class, and then referencing that when ...
2
votes
1answer
158 views

What are the motivations behind making true and false overloadable operators?

I asked this question on Stack Overflow and it was met with negative reception. I figured that Stack Overflow wasn't the right place to ask this question, so I decided to post it here. Beside making ...
0
votes
0answers
113 views

how to use Sql query to search text in CSV file and avoid iteration

I have one A File and many input files ,All files have CSV format . I want to match text of one column of all input files with one of the column of A file . I have stored all column value of File A in ...
-4
votes
0answers
48 views

parameterized query… unexpected in database using C# [migrated]

Hello there I am trying to enter database records from window Form design and programmed using MS visual C# and it approved and entered database using an other Window Form and I call the child Form ...
0
votes
1answer
70 views

How are the tiles in WORDAMENT organized?

I'm trying to create a word game, just like WORDAMENT, in my spare time. In order to present a new round, I need to create a board with 16 letters organized in a 4*4 grid. Currently, I'm generating ...
0
votes
3answers
80 views

Are EventHandler<T> and IObservable<T> interchangable?

I have an object which will periodically raise an event based on an action performed in an application. This will be heard by any listener(s) and acted upon accordingly. I do not wish to use a ...
3
votes
4answers
265 views

Is a long list of parameter checks an anti-pattern?

Background: I'm working on an application that will manage backup generators. These generators need to be able to be "linked" together. For example, Generator B might serve as a backup for ...
-1
votes
0answers
70 views

How to identify hackers based on ip addresses and the pages that were accessed [migrated]

I saw some suspicious errors being generated on my site based on pages that were requested. My error is logging the path that the user is trying to access. Because of these errors (and the paths that ...
0
votes
0answers
66 views

C# Linq question [migrated]

I am desperately trying to understand linq and now I have a concrete example of what I want to do (and fail): Console.WriteLine("{0}", (from myaddresses[x].PostalNr where x => ...
-1
votes
2answers
75 views

Class hierarchy question - do you implement separate classes for the same behavior? [closed]

NOTE: The language I am using is C#. I am currently working on a 'The Quest' mingame where there is a player and some enemies. My design so far involves a base abstract class called 'Mover' and an ...
0
votes
0answers
97 views

How can I write the code to get all the properties of a class? [migrated]

I have a program, where I want to create a new instance of the object depending on a value, I take the value and then search the list and using that list I create a new instance. Well, it goes ...
0
votes
1answer
139 views

Time Management System on Local PCs [closed]

I am looking to build a time management "app" that can be downloaded and used on an individual basis throughout my company. In theory, this app would be used to track time spent on several different ...
1
vote
3answers
210 views

How do you make sure a .net client application is not being hacked to bypass authorization claims?

We wrote a simple .NET (C#) desktop application in Wpf. We also used WIF (Windows Identity Framework) to get a list of claims for the authenticated user. Some examples are: CanOverrideSalesAmount ...
1
vote
2answers
165 views

Is this a good Visual Studio solution structure for a domain driven design RESTful web service?

I am building a .NET 4.5 C# Web API RESTful solution and I would like someone to tell me if my project solution is correct and/or wise(-enough?) for a solution designed using Domain Driven Design, ...
1
vote
1answer
245 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 ...
2
votes
2answers
106 views

What is the benefit of passing a delegate to the constructor instead of just having the client code create and pass the ParserSettings?

When answering a question on Stack Overflow, the library appeared to have a weird way to specify configuration, through an Action passed to the constructor: public Parser(Action<ParserSettings> ...
1
vote
1answer
119 views

Should the Presenter depend on the View or the vice versa?

So far, I have used the MVP architecture pattern a few times. Every now and then, I wonder whether my Presenter should depend on my View or vice versa, that is the View depends on my Presenter. NOTE ...
0
votes
2answers
152 views

Custom Video Player

I have a custom file type .mft which is basically a zip that has video inside (mpg,mp4,etc) that is encrypted/protected. My ideia is to create a custom video player which will read those .mft files, ...
0
votes
5answers
341 views

Liskov Substitution and SRP Principle violation - how best to structure this scenario?

While learning SRP and LSP, I'm trying to improve the design of my code to comply best with both of these principles. I have an employee class that has a calculatePay method on it. Firstly, I believe ...
0
votes
0answers
20 views

XNA Buffer Best Practice [migrated]

I am currently converting a 2D game to 3D, never having worked with 3D before I am trying to learn as I go. I am wondering what the best way to use vertex/index buffers is. Currently I am looping ...
4
votes
3answers
461 views

Intentionally incorrect use of language features, specifically “ref” in C#, as a hint to colleagues

I recently came across a piece of code something like this (roughly C#): public bool ValidateStuff(ref ArrayList listOfErrors, Stuff thingsToValidate) { if (!thingsToValidate.isValid() ) { ...
4
votes
1answer
152 views

Repository Pattern: Exposing Data Context to Underlying Layers

My team is in the process of updating a legacy project. We've decided to incorporate the Repository Pattern along with Entity Framework in our Data Access layer. Below is a high-level view of this ...
-4
votes
0answers
23 views

How to execute a file within a subdirectory [migrated]

So I have a small setup file that needs to install a few run-time files. The files are located within sub directories of the root of the drive. The drive letter will be different on every customers ...
1
vote
1answer
169 views

What are the benefits of using entity framework code-first instead of designing my database using SQL?

I'm currently working on designing a small web application (MVC5) and I'm to the point of designing my database. I have the schema I want worked out and I am quite proficient in SQL Server. (I have my ...
2
votes
1answer
198 views

Any OOP design pattern that is somewhat representative of all of the SOLID OOP design principles at play?

I'm trying to teach an object oriented design principles course (on SOLID) at a training institute. I also want to teach the students a few OOP design patterns such as factory, singleton and one ...
2
votes
1answer
78 views

Fire domain events after transaction completes

I am trying to implement a domain event system that only fires its events when the associated unit-of-work commits successfully. The main reason why I want to do this is because I have other ...
0
votes
0answers
65 views

Improve logic finding possible misconceptions [migrated]

I made a logic to accomplish a specific problem, but it's too long. I've sure that it can be reduce too fit it. I have the following model public class ColumnChart { public virtual ...
2
votes
2answers
139 views

Data persistence for transactional customer emails

I'm developing a system to handle sending transactional emails to our customers. This is how it works: An event occurs during the order's life cycle, for example 'shipped' This event will trigger ...
0
votes
1answer
157 views

Knowing who is the user in every request (every action, every view, every time)

I have many model classes that are mapped from/to tables using EF. Two of them are User and UserCookie, which are stored in tables Users and UserCookies. public class User { public long UserId { ...
-7
votes
0answers
34 views

How to store pdf files to MySQL and then list, open them using C# [duplicate]

I'm creating a c# employee management system app, I've created a form for Employee files and I don't have any idea how to store pdf files to mysql and then list and open them with c#.
0
votes
0answers
91 views

Login from external application in MVC

We have an ASP.Net MVC application that use Identity provider to authenticate users. A new customer now wants to access owr application pressing a button inside their winform app. I started to modify ...
2
votes
1answer
222 views

Is there a design pattern for splitting up files into smaller files?

I am developing a project where I have to load very large files (upto 50 MB). Currently I am loading these files completely into (consecutive) memory. This has the advantage that I can very easily ...
0
votes
2answers
72 views

Possible design patterns for base function with possible additions

I have various interfaces i have to implement. Let's assume ITypeA, ITypeB. They have following methods: ITypeA Connect Disconnect GetData SetData ClearData ITypeB Connect Disconnect ...
3
votes
1answer
175 views

Redundancy caused by polymorphism

I have two chat rooms, one has administration behaviour, and one doesn't. I have factored out all of the common code into a base chat room, but the AdministerChatroom behaviour I have pulled out into ...
0
votes
0answers
4 views

Displaying Fibonacci sequence [migrated]

wrote a program to calculate and display the first 20 fibonacci numbers, the sequence goes as follows: 1, 1, 2, 3, 5, 8, 13... (each number is the sum of the previous two numbers) The problem is ...