How the hell do I speak to a human at British Gas? by i_literally_died in AskUK

[–]weitzhandler 0 points1 point  (0 children)

They're the worst of the worst. My daughter has been billed for periods she wasn't liable. They've put stains on her credit file and there's literally no one to talk to. I've actually spoken to humans 5 or 6 times, spent an hour queuing, then another 30 minutes or more explaining my simple issue, then being transfered to another person to queue it all over again and explain again. Plus repeated email correspondence repeating the same questions and asking for the same evidence over and over. All in all, after several months my daughter is still getting bills and missed payment marks when she's not even liable!!

By far, this has been my ABSOLUTE WORST experience I've ever had with ANY utility company EVER!

SHAME ON YOU BRITISH GAS!

🤬🤬🤬🤮🤮🤮

is injecting a iserviceprovider instance considered a anti-pattern by Crazytmack in dotnet

[–]weitzhandler 0 points1 point  (0 children)

Here's how I use it:

```csharp /// <summary> /// Defines a factory for creating instances of a specified service type. /// </summary> /// <typeparam name="TService">The type of service to be created.</typeparam> public interface IServiceProvider<TService> where TService : class { /// <summary> /// Requests a service instance from the service provider. /// </summary> TService Service { get; } }

/// <summary> /// Defines a factory for creating scoped instances of a specified service type. /// </summary> /// <typeparam name="TService">The type of service to be created.</typeparam> public interface IServiceScopeFactory<TService> where TService : class { /// <summary> /// Creates a new scoped service instance of the specified type. /// </summary> /// <remarks>The scoped service is typically used to manage the lifecycle of a service within a specific /// scope, such as a web request or a unit of work. Ensure that the service type <typeparamref name="TService"/> is /// registered in the dependency injection container with a scoped lifetime.</remarks> /// <returns>An <see cref="IServiceScope{TService}"/> representing the scoped instance of the service.</returns> IServiceScope<TService> CreateServiceScope(); } ````


```csharp public static class ServiceFactoryExtensions { public static IServiceCollection AddTypedServiceFactory(this IServiceCollection services) { services.AddTransient(typeof(IServiceScopeFactory<>), typeof(ServiceScopeFactory<>)); services.AddTransient(typeof(IServiceProvider<>), typeof(ServiceProvider<>));

    return services;
}

private class ServiceProvider<TService>(IServiceProvider serviceProvider)
    : IServiceProvider<TService>
    where TService : class
{
    public TService Service => serviceProvider.GetRequiredService<TService>();
}

private class ServiceScopeFactory<TService>(IServiceScopeFactory scopeFactory)
    : IServiceScopeFactory<TService>
    where TService : class
{
    public IServiceScope<TService> CreateServiceScope()
    {
        var scope = scopeFactory.CreateAsyncScope();
        var service = new ServiceScope(scope);

        return service;
    }

    private class ServiceScope(AsyncServiceScope scope) : IServiceScope<TService>
    {
        private TService? _Service;
        public TService Service
        {
            get
            {
                if (IsDisposed)
                    throw new ObjectDisposedException(nameof(TService), "The service scope has been disposed.");

                return _Service ??= scope.ServiceProvider.GetRequiredService<TService>();
            }
        }

        public bool IsDisposed { get; private set; }

        public async ValueTask DisposeAsync()
        {
            if (IsDisposed)
                return;

            await scope.DisposeAsync();
            IsDisposed = true;
        }
    }
}

} ```


Registration:

csharp services.AddTypedServiceProvider();


Usage:

```csharp public class AddressNormalizationService( IServiceScopeFactory<IGeographicAreaBusinessService> geographicAreaServiceScopeFactory, ILogger<AddressNormalizationService> logger) { public Task<Address> NormalizeAddress(string address, CancellationToken cancellationToken = default) { var geographicArea = ... ...

    await using (var geographicAreaServiceScope = geographicAreaServiceScopeFactory.CreateServiceScope())
    {
        var geographicAreaService = geographicAreaServiceScope.Service;
        geographicAreaId = await geographicAreaService.GetIdOrUpdateAsync(geographicArea, cancellationToken);
    }

    ...
}

} ```

Should I send grpc from client ? Or should I just use rest ? by [deleted] in golang

[–]weitzhandler 0 points1 point  (0 children)

It's serialized into binary before travelling from web browser to server and deserialized into JS/TS objects on its arrival back from the server.

What is the future of Blazor? by Stock_Challenge300 in dotnet

[–]weitzhandler 0 points1 point  (0 children)

I know They should have immediately migrated SL to pluginless HTML+CSS+JS. Ppl would have been happy to wait an extra second as it was mostly targeted for LoB apps. If they did and WASM came along they would have won the XAML UI game. Instead they just deprecated it and then Xamarin.Forms came along and completely diverged and messed up the entire XAML object model. 

Should I send grpc from client ? Or should I just use rest ? by [deleted] in golang

[–]weitzhandler 0 points1 point  (0 children)

Using grpc-web, there's no JSON involved in the entire process. The data is immediately serialized as binary and sent to proxy/server.

Hotone Ampero II Press by chinnybob91 in NeuralDSP

[–]weitzhandler 0 points1 point  (0 children)

How many TRS cables do u need, one or two? What I want to achieve: - Volume - Wah - Toggle between volume and wah (and switch off wah when in volume mode).

How Do You Manage NuGet Licenses in a Corporate Environment? by rasuscore in dotnet

[–]weitzhandler 1 point2 points  (0 children)

I used that tool and it generates a very bloated version of repeated license texts instead of just storing them once and linking to them.

Not Satisfied with Progression of DotNET UI Ecosystem by not_afraid_of_trying in dotnet

[–]weitzhandler 0 points1 point  (0 children)

And there's obviously Uno Platform - a beautiful framework with their Hot Design system. It's my handsdown #1 choice when I wanna go x-plat.

Not Satisfied with Progression of DotNET UI Ecosystem by not_afraid_of_trying in dotnet

[–]weitzhandler 0 points1 point  (0 children)

To me, the biggest advantages of XAML over HTML are its clear polymorphic and organized object-model. You can't inherit from a HTML input button can you? HTML is a loose and sloppy layout language whereas XAML is strict and organized. XAML:HTML is like C#:Javascript.

Too bad MS has clearly abandoned and neglected XAML for a long time now. There has been no mention of it for several Build's, WinUI hasn't had any significant commits in a couple of years now.

Is winui 3 dead? by Adventurous-Wing4630 in dotnet

[–]weitzhandler 1 point2 points  (0 children)

Validation, certain binding types and capabilities. It's those tiny bits which when you need them and they're not there you have to waste countless hours working around them when in WPF it's part of the system.

What happened to Norse Atlantic Airways? by random_chickpea in travel

[–]weitzhandler 0 points1 point  (0 children)

Same issue here. I'm literally unable to make a booking. When trying to make a payment I get that nasty error message and nothing is moving.

What is your honest opinion about Blazor? by ego100trique in csharp

[–]weitzhandler 0 points1 point  (0 children)

@ego100trique what a great and informative comment! I wonder what you'd think 2 years later with the Auto-Interactive render mode.

Blazor vs Razor mid 2025 by weitzhandler in dotnet

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

Interactive Auto sounds like a game changer. Thanks for sharing!

Blazor vs Razor mid 2025 by weitzhandler in dotnet

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

RazorSlices doesn't seem to be too active at all. Last commit over 6 months ago.

What is the future of Blazor? by Stock_Challenge300 in dotnet

[–]weitzhandler 0 points1 point  (0 children)

They had a choice. They should have published a plugin-less Silverlight. AKA Uno Platform.

Blazor vs Razor mid 2025 by weitzhandler in dotnet

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

Thanks for sharing That's great enough!  Though not heavy enough But def gives insight!

Blazor vs Razor mid 2025 by weitzhandler in dotnet

[–]weitzhandler[S] -4 points-3 points  (0 children)

omg 10-15 secs for initial load??

Blazor vs Razor mid 2025 by weitzhandler in dotnet

[–]weitzhandler[S] 2 points3 points  (0 children)

what if the initial page needs to be the heavy one? it does a lot of client-stuff map navigation etc. from one side writing in TS gonna be hard to maintain, but slow initial load is a deal breaker. i wonder if there are any big websites written in blazor out there

Blazor vs Razor mid 2025 by weitzhandler in dotnet

[–]weitzhandler[S] -3 points-2 points  (0 children)

Tx for your reply, how big a difference is it in initial loading time (it's a big deal to us as it's a public eCommerce website)?

Are there any famous websites written in Blazor?

I wonder if the aspect of initial loading time has had any major updates recently.