-
Type:
New Feature
-
Resolution: Works as Designed
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 1.7
-
Component/s: LINQ
-
None
-
🔵 Done
-
None
-
None
-
None
-
None
-
None
-
None
In LINQ2SQL I could wrote:
Unable to find source-code formatter for language: cs. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
public static int? GetIDByHash(this IQueryable<Picture> source, byte[] hash) { return source .Where(p_ => p_.Hash == hash) .Select(p_ => (int?)p_.ID) .SingleOrDefault(); }
But in LINQ in MongoDB i can't do this. I have to do so:
Unable to find source-code formatter for language: cs. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
public static int? GetIDByHash(this IQueryable<Picture> source, byte[] hash) { var pic = source.SingleOrDefault(p => p.Hash == hash); return pic != null ? pic.ID : default(int?); }
This saddens me.
The same issue appears with the Cast<int?>() operator.