Click here to Skip to main content
15,909,604 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: 2... Pin
Nish Nishant25-Aug-16 4:49
sitebuilderNish Nishant25-Aug-16 4:49 
GeneralIs it me or is this a really weird VS bug? Pin
Sander Rossel25-Aug-16 1:21
professionalSander Rossel25-Aug-16 1:21 
GeneralRe: Is it me or is this a really weird VS bug? Pin
phil.o25-Aug-16 1:27
professionalphil.o25-Aug-16 1:27 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Sander Rossel25-Aug-16 1:33
professionalSander Rossel25-Aug-16 1:33 
GeneralRe: Is it me or is this a really weird VS bug? Pin
phil.o25-Aug-16 2:12
professionalphil.o25-Aug-16 2:12 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Sander Rossel25-Aug-16 2:17
professionalSander Rossel25-Aug-16 2:17 
GeneralRe: Is it me or is this a really weird VS bug? Pin
phil.o25-Aug-16 2:20
professionalphil.o25-Aug-16 2:20 
GeneralRe: Is it me or is this a really weird VS bug? Pin
raddevus25-Aug-16 4:56
mvaraddevus25-Aug-16 4:56 
Get LINQPad - The .NET Programmer's Playground[^]
Then add the following code and run it.
Even if e.Operator is set to null (each time x is an odd number) then it never fails.

I blame Visual Studio!!! Big Grin | :-D

C#
void Main()
{
	Console.WriteLine(ExpressionModel.ConditionOperators);
	
	for (int x = 0; x<100;x++)
	{
		
		Console.WriteLine(ExpressionModel.ConditionOperators.Contains(null));
		if (x % 2 == 0)
		{
			e.Operator = "eq";
		}
		else{
			e.Operator = null;
		}
		Console.WriteLine(ExpressionModel.ConditionOperators.Contains(e.Operator));
	}
}

public static class e{
	public static  String Operator;
	static e()
	 {
		Operator = null;
	}
}

public class ExpressionModel
{
    public static readonly IEnumerable<string> ConditionOperators = new[] { "eq", "neq", "gt", "gte", "lt", "lte", "between" };
     
}


Output


5String[] (7 items)4
eq
neq
gt
gte
lt
lte
between


False
True
False
False
False
True
False
False
False
True
...
My book, Launch Your Android App, is available at Amazon.com.

GeneralRe: Is it me or is this a really weird VS bug? Pin
Sander Rossel25-Aug-16 5:31
professionalSander Rossel25-Aug-16 5:31 
GeneralRe: Is it me or is this a really weird VS bug? Pin
raddevus25-Aug-16 8:27
mvaraddevus25-Aug-16 8:27 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Sander Rossel25-Aug-16 22:13
professionalSander Rossel25-Aug-16 22:13 
GeneralRe: Is it me or is this a really weird VS bug? Pin
patbob25-Aug-16 5:39
patbob25-Aug-16 5:39 
GeneralRe: Is it me or is this a really weird VS bug? Pin
raddevus25-Aug-16 8:28
mvaraddevus25-Aug-16 8:28 
JokeRe: Is it me or is this a really weird VS bug? Pin
Marc Clifton25-Aug-16 1:40
mvaMarc Clifton25-Aug-16 1:40 
GeneralRe: Is it me or is this a really weird VS bug? Pin
#realJSOP25-Aug-16 1:54
professional#realJSOP25-Aug-16 1:54 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Marc Clifton25-Aug-16 2:13
mvaMarc Clifton25-Aug-16 2:13 
GeneralRe: Is it me or is this a really weird VS bug? Pin
harold aptroot25-Aug-16 1:54
harold aptroot25-Aug-16 1:54 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Sander Rossel25-Aug-16 2:08
professionalSander Rossel25-Aug-16 2:08 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Dan Neely25-Aug-16 2:46
Dan Neely25-Aug-16 2:46 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Sander Rossel25-Aug-16 2:49
professionalSander Rossel25-Aug-16 2:49 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Dan Neely25-Aug-16 3:17
Dan Neely25-Aug-16 3:17 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Sander Rossel25-Aug-16 3:18
professionalSander Rossel25-Aug-16 3:18 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Dan Neely25-Aug-16 3:21
Dan Neely25-Aug-16 3:21 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Sander Rossel25-Aug-16 3:31
professionalSander Rossel25-Aug-16 3:31 
GeneralRe: Is it me or is this a really weird VS bug? Pin
Ryan Peden25-Aug-16 3:30
professionalRyan Peden25-Aug-16 3:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.