I'm working on two UpForGrabs issues.
issue 1904 and Enum.HasFlag.
Both fixes work, but I'd like to know how null is supposed to be treated.
e.g. foo.HasFlag(null);
This should throw, so either the null constant can be caught in LinqExpression level and throw.
Or, the value could be translated to a DbExpression and then catch the DbNullExpression and throw.
If the later approach is preferred, what type should the DbNull be created from?
int64? int32? byte?
Another case is in issue 1904:
e.g. select new { StringAndNullableInt = "foo" + (int?)null }
In this case, the null value is a constant null, the type is not carried over to the linq expression.
So there is no way to create a typed null so to say.
The expression is still valid though... the result should be "foo" in the above case.
These are ofcourse both edgecases but it would still be nice to have a uniform way to deal with them.
issue 1904 and Enum.HasFlag.
Both fixes work, but I'd like to know how null is supposed to be treated.
e.g. foo.HasFlag(null);
This should throw, so either the null constant can be caught in LinqExpression level and throw.
Or, the value could be translated to a DbExpression and then catch the DbNullExpression and throw.
If the later approach is preferred, what type should the DbNull be created from?
int64? int32? byte?
Another case is in issue 1904:
e.g. select new { StringAndNullableInt = "foo" + (int?)null }
In this case, the null value is a constant null, the type is not carried over to the linq expression.
So there is no way to create a typed null so to say.
The expression is still valid though... the result should be "foo" in the above case.
These are ofcourse both edgecases but it would still be nice to have a uniform way to deal with them.