Omgili - forum search, search forums  
  

Discussions about return null

Displaying 1 - 10 out of 45,853 discussions.  
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
I have a class with a static public property called "Info". via reflection i want to get this properties value, so i call: PropertyInfo pi myType.GetProperty("Info"); string info = (string) pi.GetValue(null, null); this works fine as long as the property...
Started by on , 6 posts by 6 people.  
My first guess would PluginInfo _PluginInfo = null; public static IPluginInfo PluginInfo { get { if (_PluginInfo == null = "PluginVersion"; } ....
That way you can break the debugger and look at the return value before it's lost.
I need to do a comparaison between an object and NULL. When the object is not NULL I fill it with some data. Here is the code : if (region != null) { .... } This is working but when looping and looping sometime the region object is NOT null (I can see...
Started by on , 8 posts by 8 people.  
R2)) { // handles if both are null as well as object identity return true; } if ((object)r1 == null || (object)r2 == null) { return false; } return (r1.Cmr.CompareTo(r2.Cmr) == 0 && r1.Id == r2.Id operator !....
I have a link query that looks like this... var duration = Level3Data.AsQueryable().Sum(d => d.DurationMonths); If all the d.DurationMonths values are null the Sum returns 0. How can I make the Sum return null if all the d.DurationMonths are null? ...
Started by on , 4 posts by 4 people.  
As you indicated = Level3Data.AsQueryable(); var duration = q.All(d => d.DurationMonths == null) ? null : q.Sum(d => = Level....
) ? Level3Data.AsQueryable().Sum(d => d.DurationMonths) : null; Using Sum alone, this is impossible.
Ask your Facebook Friends
So let's say you have a function that returns a date Date myFunc(paramA, paramB){ //conditionally return a date? } So is it appropriate to return null from this function? This seems ugly because it forces clients to check for null. The "null object" pattern...
Started by on , 9 posts by 9 people.  
Document that it could return null, however(); }....
However if you want to return null on an error, consider throwing into the function far more than just getting a null returned.
null is quite acceptable.
How do you return 0 instead of null when running the following command: SELECT MAX(X) AS MaxX FROM tbl WHERE XID = 1 (Assuming there is no row where XID=1)
Started by on , 7 posts by 7 people.  
MAX(X), 0, MAX(X)) AS MaxX FROM tbl WHERE XID = 1 or SELECT CASE MAX(X) WHEN NULL THEN 0 ELSE MAX(X use COALESCE ( expression [ ,...n ] ) - returns first non-null like: SELECT COALESCE(MAX(X),0.
I have this code $return = $ep->$method($params); if ($return === null) { throw new Exception('Endpoint has no return value'); } return $return; Is there any way to distinguish between a method that returns null and a method that does not return anything...
Started by on , 4 posts by 4 people.  
Use null and you can use isEmpty see php....
You can return another value? Boolean true possibly, and check for that or null.
When no return value is set the function automatically returns null.
It's not possible.
Is it possible for a VB.net function with a return type of integer to return null ?
Started by on , 4 posts by 4 people.  
Both dommer and Mitch....
If you're strictly talking about a null reference (C#'s version of null) then the answer is No.
You'll need a return type of Nullable(Of Integer).
Only if it is defined as returning a nullable integer.
Hi all, I have a, I think fairly easy, question, but I can't figure out what I'm doing wrong. I have a function which i call with PHP's function eval . I'm expecting an, selfbuilt, ArrayList to get as a result. But instead when I use gettype I see the...
Started by on , 5 posts by 5 people.  
The return....
Although bar() returns a value foo=eval('bar();'); var_dump($x); $x=eval('return bar();'); var_dump($x); prints NULL int(1() does not.
() { return 1; } $x=foo(); var_dump($x); the output will be `NULL'.
I have a method that is suppose to return an object if it is found. If it is not found, should I: a) return null b) throw an exception c) other
Started by on , 32 posts by 32 people.  
Generally it should return null then: Object....
Client code can then decide what to do.
The (for lack, then it's best to return null.
I prefer to just return a null, and rely on the caller to handle it appropriately.
Var adminCov = db.SearchAgg_AdminCovs.SingleOrDefault(l => l.AdminCovGuid == covSourceGuid); adminCov keeps coming back null. When I run SQL profiler, I can see the generated linq, when I past that into management Studio, I get the result I expect....
Started by on , 5 posts by 5 people.  
It will return null when.
SingleOrDefault will return null if there are no matches FirstOrDefault to get the first match if there is at least one match.
Or more than one record matching the criteria.
Page: 1   2   3   4   5   6   7   8   9   10  
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost