Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
C# is a multi-paradigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform. Use this tag for questions related to C#. In case a specific version of the framework is used, you could also include that tag; for instance .net-2.0.
4
votes
Is it ok to use HttpContext inside View?
I think it is controller's responsibility to decide what should be visible to user. So it looks to me like a good idea to pass some boolean flags to ViewData dictionary like
VeiwData["IsSomeUserSpeci …
4
votes
Accepted
Design Pattern Question/Violating OCP
I would suggest something like that
public interface IDeviceScript
{
string Name { get; }
string SecurityScriptName { get; }
string BusinessScriptName { get; }
bool IsScriptApply(IDev …
2
votes
Proper way to execute parameterized commands within a method
If you say that this method should be as reusable as possible then I assume that it will be used throughout the program. Then why it takes SqlParameterCollection parameter? All non DAL classes should …
1
vote
Unit tests for testing error codes
I think these two test test two different things. 1st test test correctness of error messages formatting, 2nd - that appropriate method was called.
What I don't understand is why do you need expectedE …
1
vote
Wrapper for caching methods in ASP.NET
I see a minor issues with the code: you are locking every time, no matter if it's needed on not. I would implemented GetFromCache like this
public T GetFromCache<T>(string key, object cacheLock, Func …
0
votes
Group collections by their elements property
Maybe I'm missing something but it seems that your code have strange behavior. If orders and payments collections have items with same CustomerId as in invoices collection then by checking
if (!re …
0
votes
Handling optimistic concurrency violations
using (SqlConnection connection = new SqlConnection(""))
{
try
{
//open connection
if (connection.State != System.Data.ConnectionState.Open)
Why …