The .NET Framework is a software framework for Microsoft Windows operating systems. It includes an implementation of the Base Class Library, Common Language Runtime, and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++.

learn more… | top users | synonyms

0
votes
2answers
64 views

Separate methods or single method with if statement?

I'm working on a .NET application and I'm wondering if I should use separate methods to handle the click events of two different buttons. They essentially do the same thing, just on different objects ...
1
vote
2answers
107 views

Implementing a generic/dynamic custom property system in C#

I have an architecture design problem which I think is appropriate for this site. General problem description: My primary goal is to design a software library/program (C#) to automate a very ...
3
votes
1answer
64 views

Wpf: Event driven vs MVVM design pattern

I'm a beginning coder and I've been working on a WPF app for several months now and struggled to implement anything in MVVM due to time constraits to learn so I coded my program the only way to knew ...
4
votes
1answer
102 views

Is there a better alternative than abusing the IDisposable pattern?

Consider the following (Microsoft-sanctioned) code: <% using (Html.Form<HomeController>(action=>action.Index())) { %> <input type="text" id="search" /> <input ...
-1
votes
1answer
261 views

Are there any scenarios where the 'Dispose Pattern' shouldn't be used on an Object which contains managed and un-managed resources?

MSDN says that to properly clean up an object which contains managed and un-managed resources, you need to implement the 'Dispose Pattern'. Given that the class implements the IDisposable interface, ...
2
votes
0answers
237 views

Why does the .NET framework have no concept of classes as first-class types?

It's well known to those familiar with the history that C# and the .NET framework started out as essentially "Delphi rewritten to feel like Java," architected by the chief developer behind Delphi, ...
0
votes
1answer
74 views

How stable are Single Page Application (SPA) build with Microsoft .Net for enterprise application [closed]

Imagine a situation where you have your data loading to your application via REST Api,you are building a responsive application(ajax request) for an Enterprise. What potential problems might I run ...
1
vote
1answer
72 views

Performing a Depth First Search iteratively using async/parallel processing?

Here is a method that does a DFS search and returns a list of all items given a top level item id. How could I modify this to take advantage of parallel processing? Currently, the call to get the sub ...
1
vote
2answers
87 views

How best to construct our test subjects in unit tests?

Some of our business logic classes require quite a few dependencies (in our case 7-10). As such when we come to unit test these the creation become quite complex. In most tests these dependencies are ...
0
votes
1answer
94 views

Can't understand on how to implement MVP/MVC for my software requirements [closed]

Recently I decided to start developing a client/service based system using WCF and a Duplex Channel (callbacks from Service to client). The clients will behave as "slaves", that is, they will only ...
0
votes
1answer
81 views

Passing in config values to a method using SOLID principles

I have an email helper class that has a method that sends email: private static class EmailHelper { public static void SendEmail(string from, string to, string subject, string message) { ...
-2
votes
1answer
56 views

How to get a database on my filesystem that I can use in my application [closed]

I'm making a .NET application where I'll have a lot of data entries. This will not go to any server though, but needs to be stored and updated, frequently on the local machine. I would like something ...
1
vote
1answer
34 views

How can I share a managed DBConnection across various objects?

I am implementing what I thought was a simple object wrapper around a database where one object "PartRecord" represents one row of a database table. I want a client to be able to request a given ...
3
votes
1answer
138 views

Have enterprises adopted pure FP to create desktop user interfaces? Examples? [closed]

I see some evidence (F#) online that functional programming is penetrating enterprise. Where I work we primarily develop VB.NET WinForms applications. The .NET infrastructure for developing ...
0
votes
0answers
4 views

how to send mail using Exchange server through proxy server [migrated]

MailMessage mail = new MailMessage(); mail.To.Add("**"); mail.CC.Add("*"); mail.From = new MailAddress("*"); mail.Subject = "Salesforce Credential for ...
1
vote
0answers
44 views

Querying the NuGet official source asynchronously? [closed]

I've been playing around with the NuGet.Core package to see if I can search the NuGet repository for specific packages. I started with the sample code: //ID of the package to be looked up string ...
1
vote
4answers
231 views

Why does Microsoft still ship VBA within Office products, instead of integrating .NET directly? [closed]

I know that it's possible to call .NET code from your VBA code, but why does VBA continue to exist? The only reason I can think about is legacy. I just had to sort a Scripting.Dictionary and the ...
2
votes
1answer
22 views

Licencing GNU GPlv3 - sofware provides a service - not distributed

I have a couple questions with regard to the GNU GPLv3 license. My application is closed-source and I do not intend to actually release it to the public. However, it does generate commercial items. ...
3
votes
1answer
167 views

Java-Like 'throws'-information in method signature C#

From Java I know that the signatures of methods that can throw exceptions contain a throws block, that contains the Exception(s) that might be thrown. In C# there is no such thing and it is also not ...
0
votes
2answers
66 views

How do I ensure my site will be crawled when articles are generated by the database?

I wasn't sure how to ask the question. But basically, it's a textbook scenario. I'm working on a site that's article based, but the article information is stored in a database. Then the page is ...
0
votes
0answers
28 views

Structuring Resource Files

In .NET we've got Resource files which are great for allowing providing translations across your application. In the past I've seen these resource files grow into monolithic unmaintainable lists of ...
1
vote
1answer
39 views

What is Object Services class purpose?

I'm reading a book on TDD: (btw this question has nothing to to with TDD) link to the book on amazon Author often mentions/uses Service Classes For example we would have a Person Object Person would ...
2
votes
1answer
85 views

will having an event with subscribers prevent an object from being GC'ed?

I have an object, which has an event which in turn has subscribers. I know that the subscribing objects won't get GC'ed since the delegate they stored for the event is connected to them, thus keeping ...
-1
votes
1answer
110 views

How to learn new technologies in short period of time? [duplicate]

The title says it all. I'm a .NET programmer, working mostly on WPF applications with C#. But I need to be familiar with latest web development technologies, JavaScript, HTML5, CSS, ASP.NET MVC, ...
-4
votes
1answer
115 views

How does code coverage work?

Specifically, what is contained inside code coverage data (.nccov or xml file) and how is an html report generated by this? Does the coverage data not include the actual percentage of code covered? Is ...
2
votes
1answer
127 views

Is there a way to use RAII techniques in COM?

I am caught between two conceptual models of how to construct objects, and am having trouble working out what standard I want to adopt. I prefer to program in .NET and often try to use RAII and ...
0
votes
1answer
64 views

Best way to deploy database-dependant application

I have always "custom developed" software for clients. This means: Develop the software Install SQL Express on client site Import DB, create DB user, set DB permissions etc. Install software on ...
0
votes
1answer
79 views

Return tasks or expose events? [closed]

What is preferable when you program an API? And I have to add that in my case there will be two events exposed in spite of everything.
2
votes
1answer
102 views

What is a good design approach in .NET for performing a series of checks in background process?

I have a flight planning system in .NET/SQL Server which needs to perform several validation checks. This needs to work on both a windows and a web client. Currently the checks run synchronously but ...
2
votes
1answer
90 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
2answers
95 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
3answers
42 views

Reliable secure data exchange between service written on .NET and an iOS client app

I have a service written on .NET working on a company server. It designed to do a very simple thing, to receive a request via WCF named pipes from another service working locally on the same server, ...
1
vote
1answer
69 views

Should a domain object wrap/contain a DTO interface?

Using .NET - I have an interface IPerson. This interface is implemented by classes in multiple, separate repositories, e.g. EF6 (EfPerson), custom SQL (SqlPerson), or even custom assembly connecting ...
1
vote
2answers
95 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 ...
2
votes
1answer
136 views

Choosing between the view and the controller for my code

I'm aware there are a lot of topics about MVC design but it's hard to find good explanations: what I should do, what are the consequences of the different possibilities... So I'm working on an ASP ...
0
votes
0answers
47 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 ...
0
votes
1answer
113 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 ...
2
votes
1answer
82 views

How to define item level permissions in a relational database

I need to model a database design to provide item level permissions to users based on the user's role access. I am using asp.net with sql server 2012 I am looking at similar experience on how ...
1
vote
1answer
122 views

Repository Pattern: Doctrine2 vs Microsoft Entity Framework?

I have been using Symfony2 with Doctrine2 for some years. I have recently started using Microsoft's Entity Framework with MVC5. From my Symfony2 experience I understand that a repository's job is only ...
4
votes
4answers
222 views

Is it OK to let invalid arguments slip to another method?

For example lets take this method: public List<string[]> ReadAll(int listCapacity) { List<string[]> list = new List<string[]>(listCapacity); while (Read()) { ...
6
votes
2answers
175 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 - ...
5
votes
2answers
220 views

Was .NET's IObserver<T> intended for subscribing to multiple IObservables?

There are IObservable and IObserver interfaces in .NET (also here and here). Interestingly, the concrete implementation of the IObserver does not hold a direct reference to the IObservable. It ...
3
votes
1answer
158 views

Compiler warnings and errors [duplicate]

I come from a C# background before my existing role. I am developing a VB.NET app. The code I inherited had option strict set to off and all other directives set to 'None'. I have recently switched ...
1
vote
2answers
181 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 ...
-1
votes
1answer
71 views

Choosing a file format to storage a simple text data [closed]

My .NET application makes its work and then creating a report (an Excel worksheet). The report holds thousands of short text strings [KEY - VALUE], so excel worksheets suites very well, one column ...
1
vote
1answer
146 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 ...
1
vote
1answer
134 views

What does it mean when code “runs on” the .NET CLR?

The .NET CLR is not an interpreter, since code gets compiled to native code by the JIT compiler. So I find the usual description of code "running on" the CLR confusing. How does the native code ...
3
votes
1answer
90 views

Architecture for maintaining/executing multiple versions of same strategy / functionality in live application

So I am working with a customer who has an older application that has quite a few interesting quirks. Among other things, it has its own code version system for business functions, by storing the ...
2
votes
2answers
267 views

Reduce number of if statements through design pattern

I had a loop through object Process, each process instance can be of a different type, derived from Process base class (e.g.: Process1, Process2,...). Each derived type of Process has different ...
2
votes
3answers
320 views

invoking methods within a conditional expression

In an oft-cited (if dated) reference for C# coding standards (pdf; from Lance Hunt), the statement is made, 33. Avoid invoking methods within a conditional expression. I've not seen this ...