by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 21:39

    gafter on master

    Propose Feb 11 agenda (#2187) (compare)

  • Jan 31 2019 21:39
    gafter closed #2187
  • Jan 31 2019 19:42
    gafter edited #2115
  • Jan 31 2019 15:46
    jcouv edited #1565
  • Jan 31 2019 14:51
    yigitgursoy closed #1958
  • Jan 31 2019 13:43
    ichensky closed #2190
  • Jan 31 2019 12:17
    ichensky opened #2190
  • Jan 31 2019 04:38
    MarkPflug edited #2189
  • Jan 31 2019 04:37
    MarkPflug edited #2189
  • Jan 31 2019 04:37
    MarkPflug edited #2189
  • Jan 31 2019 04:36
    MarkPflug opened #2189
  • Jan 30 2019 23:15
    MohammadHamdyGhanem opened #2188
  • Jan 30 2019 20:01
    gafter review_requested #2187
  • Jan 30 2019 20:01
    gafter review_requested #2187
  • Jan 30 2019 20:01
    gafter review_requested #2187
  • Jan 30 2019 20:01
    gafter assigned #2187
  • Jan 30 2019 20:01
    gafter opened #2187
  • Jan 30 2019 20:00

    gafter on gafter-2019-02-11-agenda

    Propose Feb 11 agenda (compare)

  • Jan 30 2019 17:11
    tannergooding opened #2186
  • Jan 30 2019 15:52
    lust666 closed #2185
Omar Himada
@omarhimada
probably your enumerable is not coming from the database? i'm assuming
Joseph Musser
@jnm2
That must be the case.
Sounded like you were including linq to objects also in your second two sentences, but I misunderstood.
Omar Himada
@omarhimada
i think you're right I may have been executing some expression on an IQueryable<T>. perhaps doing AsEnumerable() or even a ToList() may act as a workaround!
Joseph Musser
@jnm2
Not if it executes a new query though, because SqlClient makes native calls (if I understood the problem right)
IIRC .AsEnumerable() and .ToList() themselves execute a new query
Omar Himada
@omarhimada
ahhh so i would have to actually do an AsEnumerable() within the source and then watch that instead.
yeah thats not ideal
Joseph Musser
@jnm2
So you're right, the debugger doesn't do native calls and there's no special-casing for SqlClient, so no linq-to-sql in the watch window.
I wonder if that's a Roslyn thing or if it's in the closed-source .NET Core debugger
Omar Himada
@omarhimada
if i recall at least 99% of the time that i run into this issue its because i want to just verify that some specific record is making its way through a piece of logic (as a means of troubleshooting for example), and hovering over the IQueryable while stopped on a breakpoint, and attempting to enumerate the thing there and then, either takes an extremely long time, breaks, or there are so many records that scrolling through the little inspector window/widget to find the record is not feasible
Joseph Musser
@jnm2
Do you think any of the recent search features could help?
Omar Himada
@omarhimada
?? recent search features
(also applies in the watch window and debugger tooltips)
Omar Himada
@omarhimada
interesting, those look useful for sure, but i am betting that it would result in the same issue where it will fail in attempting to evaluate a lambda expression via LINQ-to-SQL
without enumerating the object within the compiled source before debugging
i'll have to try to be sure
Joseph Musser
@jnm2
Yes. Maybe a workaround for you could be to use dbContext.SomeDbSet.Local.Where(...) because that should be linq-to-objects
Omar Himada
@omarhimada
thats funny i recall seeing "Local" but i never knew what it did. thank you for that
Joseph Musser
@jnm2
It enumerates all entities tracked as added, unchanged, or modified (https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbset-1.local?view=efcore-3.1)
So it would only contain entities that were loaded before you paused in the debugger.
Joseph Musser
@jnm2
https://www.nuget.org/packages/jnm2.ReferenceAssemblies.net35 is far and away my most popular NuGet package
It's probably going to speed up now that the msbuild repo is going to use it in its infrastructure: dotnet/msbuild#5621
(I found the decision not to include net35 in https://www.nuget.org/packages/Microsoft.NETFramework.ReferenceAssemblies deeply unsatisfying. It irked me into action. Over conference WiFi in Las Vegas even.)
Joseph Musser
@jnm2
whoa, when did dotnet/roslyn start using it?
Since July 8. That explains some things. dotnet/roslyn#45690
I'm still waiting for someone to be mad and come after me. I have a trick up my sleeve the moment that happens.
Joseph Musser
@jnm2
There is a list of people who appear not to be mad about it, so I'm still wondering who originated the directive that net35 should not be officially buildable by the .NET Core SDK. Especially given that net35 is a supported OS component, and net20 and net40 (which are buildable by the .NET Core SDK) are out of support. Hopefully we can still be friends.
Omar Himada
@omarhimada
i'm up to 4.4k downloads on one of mine, and 2.1k+ on another
126k very nice :o
Joseph Musser
@jnm2
126k should be compared to the 3.5m of the https://www.nuget.org/packages/Microsoft.NETFramework.ReferenceAssemblies that should have included it
masonwheeler
@masonwheeler
so about 3.6%
Joseph Musser
@jnm2
Nice. That's the percentage of folks that build projects using the .NET Core SDK that includenet35 targets
s/folks/builds
Dave Yost
@daveyostcom
  class Program {

    static void bar(Action<IComparable> f) => f(15);

    static void Main(string[] args) {

      // This cast can die at runtime, and that's ok.
      bar(ic => {
        int d = (int) ic;
        Console.WriteLine($"Hello {d + 2}");
      });

      // This could be shorthand for the same thing.
      bar((int d) => Console.WriteLine($"Hello {d + 2}"));

    }
  }
The shorthand would be very handy in UI event handlers, and it's not unlike the type pattern is variable.
HaloFour
@HaloFour
That's already valid syntax
Joseph Musser
@jnm2
@HaloFour That's a compile error currently. It could be a rule appended to overload resolution :D
"If this would have failed, consider overloads with delegates where a single explicit cast to int exists"
I don't like making the explicit cast implicit at all.
HaloFour
@HaloFour
Yes, it's a compiler error, but not due to the syntax
Joseph Musser
@jnm2
Why would there need to be a syntax error?
HaloFour
@HaloFour
The expectation of what that syntax means, and a runtime error due to an invalid cast isn't expected
Joseph Musser
@jnm2
:+1: So you also don't like the concept that it's doing an explicit cast while looking like it's not.
You could do bar(Utils.CastAction<object, int>(d => ...))
HaloFour
@HaloFour
Yes, although I also wouldn't be surprised if he doesn't realize that a lambda can have that more verbose form :)
Joseph Musser
@jnm2
The example above can be reduced to:
bar(d => Console.WriteLine($"Hello {(int)d + 2}"));
Joseph Musser
@jnm2
Interfaces have explicit casts to and from any type, don't they?
Dave Yost
@daveyostcom

Here’s a real example (from Java).

  valueProperty.addListener(observable -> {
    BooleanProperty b = (BooleanProperty) observable;
    toggleButton.setSelected(b.get());
  });

or

  valueProperty.addListener(observable -> {
    toggleButton.setSelected(((BooleanProperty) b).get());
  });

or

  valueProperty.addListener(BooleanProperty observable -> {
    toggleButton.setSelected(observable.get());
  });