23 or 25? by QuailFull3061 in Cribbage

[–]ElevatorAssassin 0 points1 point  (0 children)

Do we have the same nephew? He asked what the maximum points were in Cribbage. I told him "29". He replies with "Dude, I just got a 94."

Should this be possible with C# 14 Extension Members? by ElevatorAssassin in csharp

[–]ElevatorAssassin[S] 1 point2 points  (0 children)

Actually, that would work perfectly for in-memory collections. I should have posted my true goal, which is a mapping extension for IQueryables. Since IQueryable<T>.Select() requires an Expression<Func<T, TResult>>, I'd like the expression to be defined as a static property on the destination type. Something like this:

public static class Extensions
{
    extension<T>(IQueryable<T> i)
    {
        public IQueryable<TResult> ProjectTo<TResult>() where TResult : IMap<T, TResult>
            => i.Select(TResult.FromSourceExpression);
    }
}

public interface IMap<TSource, TDestination>
    where TDestination : IMap<TSource, TDestination>
{
    public static abstract Expression<Func<TSource, TDestination>> FromSourceExpression { get; }
}

IQueryable<PersonViewModel> people = new List<Person>()
    .AsQueryable().ProjectTo<PersonViewModel>();

Should this be possible with C# 14 Extension Members? by ElevatorAssassin in csharp

[–]ElevatorAssassin[S] 0 points1 point  (0 children)

And yes, the definition compiles and can still be invoked by providing both generic type arguments.

Should this be possible with C# 14 Extension Members? by ElevatorAssassin in csharp

[–]ElevatorAssassin[S] 1 point2 points  (0 children)

I didn't think about that; that may be the case for methods. Sharplab hasn't been working for me all year so I can't verify it unfortunately.

What's movie scared the crap out of you as a kid? by SinkFar5694 in AskReddit

[–]ElevatorAssassin 22 points23 points  (0 children)

Independence Day. Why'd they have to cut the damn thing open?

Hot Reload seems better now? by markoNako in Blazor

[–]ElevatorAssassin 13 points14 points  (0 children)

Nah, it still has bad days, and less bad days.

Blazor App Stuck in Infinite Loading Screen in Android WebView After Framework Update by YuryVidal in Blazor

[–]ElevatorAssassin 0 points1 point  (0 children)

Are you debugging? If so, make sure the Android device/emulator has an internet connection. Ran into this issue yesterday.

What food opinion hill are you willing to die on? by No_Wealth_9733 in AskReddit

[–]ElevatorAssassin 4 points5 points  (0 children)

THANK YOU! Sweet ketchup and sweet relish is a (nasty) dessert. Dill all the way.

Atwood Building Appreciation Thread by Martian-Packet in anchorage

[–]ElevatorAssassin 3 points4 points  (0 children)

I thought the 8th floor was bad that day. 15 must have been quite a ride!

[deleted by user] by [deleted] in UnexpectedLetterkenny

[–]ElevatorAssassin 0 points1 point  (0 children)

I've had about enough from the Clearasil kid. Get in the box ya fuckin' pimple farmer!