Questions tagged [.net]

.NET is a software framework supporting a multi-language paradigm and supporting language interoperability. .NET applications are executed in a virtual machine (CLR) which provides a few important services: security, memory management and exception handling.

Filter by
Sorted by
Tagged with
4
votes
1answer
9k views

Query String Serializer

I have a ASP.NET Web Forms project, and I want to build calls to .aspx pages in a strongly-typed fashion. I ended up rolling my own serializer that takes simple structs and saves them to/loads them ...
3
votes
1answer
186 views

C# expression evaluator review request

I successfully created an expression evaluator in C#, and I would like to know if it works well, and what I can do to improve it. ...
3
votes
1answer
701 views

Review an asynchronous/message-oriented library actor

I'd like to get input on a F# actor that coordinates receives around a blocking message buffer. The actor is a piece of code that continuously tries to fetch messages from Azure Service Bus. ...
3
votes
2answers
1k views

Is the solution design optimal? C# 3 - Tier

I have the following solution structure. This is a business domain (for an amount transfer operation in bank account) which will be called by a WCF service. Is the solution structuring correct? Data ...
3
votes
1answer
2k views

Refactoring legacy code for unit testing

I'm trying to refactor some code for unit testing and was hoping you could critique it. This is the original method: ...
7
votes
3answers
4k views

ThreadSafeObservableCollection of (T)

The idea here is to implement a simple, threadsafe, observable collection that clients can bind to, whilst background threads can update. Changes in the contained items raise the ...
2
votes
2answers
1k views

Trace-like extensions for unit testing

Below is a set of extensions that I use in unit tests. The basic idea is that when creating or modifying some sort of user output type of string, I want to eyeball the output to see that it makes ...
4
votes
1answer
472 views

Find log4net logfiles at runtime without adding dependency to project

I was searching for a way to get all active log4net logfiles (if any) at runtime without adding a reference to the project. This is the solution I came up with: ...
4
votes
1answer
1k views

Providing factory method to Lazy<T> when factory exists on another lazy instance?

The Problem I found myself needing an instance of an IObjectContext interface that should never be null, but wanting to delay instantiation until after some ...
6
votes
1answer
476 views

Comparing DoublyLinkedList<T> implementation performance with other BCL (.NET) classes

I have implemented generic doubly-linked list class, which supports IEnumerable<T>,IEnumerator<T> interfaces. ...
3
votes
1answer
245 views

C# asp.net project functionalities

I just started working in a project that wasn't developed by me, I'm worried about some of the functionalities and I would like some suggestions. After the login validations, the login procedure is ...
5
votes
1answer
4k views

Convert .NET DateTime to a string using ordinals

With a DateTime object, it's easy to get, for example, 11 October 2011 by using: d.ToString("d MMMM yyyy"); However, there ...
5
votes
4answers
6k views

Presenting a boolean as an int for XMLSerialization in C#

I'm working with an XML structure that requires booleans to be represented as 1 or 0. So, suppose the XML output has to look like: <valid>1</valid> ...
2
votes
1answer
452 views

Simple search page.

...
7
votes
3answers
1k views

3-layer ASP.NET app - Need critique/advice

My current setup is a 3 layered application: UI > BLL > DAL. Each layer is set up as a separate project. The UI is an ASP.Net website and the BLL & DAL are Class Library projects. I've shown some ...
5
votes
3answers
1k views

Guarantee at least one in a list

This is a short piece of code but I feel like it could be done more elegantly. What am I missing? The goal: if there are any items in a list, and none of them have a given property, set one of them ...
11
votes
1answer
25k views

Converting binary value from BitArray to an int and back in C#

What I am creating is essentially a binary clock face with touch input for setting values as well as displaying - so I need to convert both ways between an int and a binary sequence in a BitArray. I ...
3
votes
2answers
146 views

Subclassing, NVI

Should the following be considered wtf code? ...
4
votes
1answer
248 views

Is there any loss in performance converting a 'where' clause to a lambda?

Is there any different in performance for the following 2 queries. I'm just wondering what is the better of the two: ...
5
votes
1answer
1k views

Trying to un-hack this DataTemplateSelector

I'm trying to emulate the default behavior of an ItemsControl in a ContentControl--Bind Content to an object property and use the correct DataTemplate based on that ...
3
votes
1answer
238 views

Refactor a subroutine that divides date range into quarters.

The subroutine below, GetDetailsQuarterly, accepts two dates. Then it writes out each quarter that falls within the date range. It also gives the first and last day of the quarter. I really don't like ...
7
votes
2answers
33k views

Is there a better way to search directories for a file or files?

Edit: The purpose of this method is to search a specific directory for a given file type, ex. (*.txt, *.pdb, *.exe") then move the file(s) to a given destination directory and delete the original ...
6
votes
1answer
4k views
6
votes
2answers
3k views

Best practice instantiating generic delegates and accessing property getters

I want to create delegates to access properties of different objects without knowing them in advance. I have the following definitions ...
8
votes
2answers
4k views

Automatic translation of forms

I want my application to support multiple UI-languages (aka i18n). To do so, I have built the static class below, to automatically translate the form and all its contents to the desired language. It ...

1
19 20 21 22
23