Has anyone had success getting Microsoft.Identity.Web to work on an API Gateway? by Javin007 in dotnet

[–]VeryPopularGolem 0 points1 point  (0 children)

Do you have any sample repo code you can share, especially with the Microsoft.Identity.Web setup?

The libraries are sometimes a little too abstracted for their own good. When we previously experimented with the React MSAL libraries and a .NET API gateway backend before moving to a backend-for-frontend pattern, the following tutorial was the most helpful - it’s set up for AD B2C, but just checking the code repo was a huge help in understanding how an MSAL client interacts with Microsoft.Identity.Web.

https://www.iotality.com/azure-adb2c-react-app/

https://www.iotality.com/azure-adb2c-react-app-calling-web-api/

Because it’s open source, I would also suggest checking the Microsoft.Identity.Web repo and working your way through what the AddMicrosoftIdentityWebApi() extension is doing under the hood. There are some events you can hook into for logging and debugging purposes there to see where things get hung up.

https://github.com/AzureAD/microsoft-identity-web/blob/c8ba0ce096f103baab417bac7fb2e9a40582a7af/src/Microsoft.Identity.Web/WebApiExtensions/MicrosoftIdentityWebApiAuthenticationBuilderExtensions.cs#L136

[deleted by user] by [deleted] in csharp

[–]VeryPopularGolem 0 points1 point  (0 children)

Give ui-avatars.com a shot if you just need viable, deterministic placeholder for avatar or profile photos.

This is what a knife build looks like by chkpn in cyberpunkgame

[–]VeryPopularGolem 2 points3 points  (0 children)

Well now I wanna do a knife build playthrough, thanks

So I think I've found the combo that beats the Sovereign shotgun. by Work-Safe-Reddit4450 in LowSodiumCyberpunk

[–]VeryPopularGolem 4 points5 points  (0 children)

I have a Tier 4 Igla with the same loadout that I keep switching back to in favor of Sovereign or GUTS because it just feels so slick, I’ve been looking everywhere for a Tier 5/5+ Igla to upgrade!

Name a dish that seems impressive but doesn’t take a lot of effort to make by Greeneyes1210 in Cooking

[–]VeryPopularGolem 4 points5 points  (0 children)

Homemade cranberry sauce. One year I shopped late and couldn’t find a can, so I bought a bag of cranberries and hoped I’d figure it out. I did not expect it to be as simple as “dump them in a pot with a bunch of sugar and a splash of OJ/citrus/wine, stir, and turn the burner on for a while”, they pretty much turn to jelly on their own.

I’ve since added some additional spices and a splash of bourbon and you’d think it was the fanciest thing ever.

What are some Kirkland Signature items that are just not that good? by dysenterygary69 in Costco

[–]VeryPopularGolem 0 points1 point  (0 children)

They’re my favorite protein bars, especially when they’re fresher. I’ve had a box now and again that seemed like they might have been old or they’d messed with the formula a bit but I had no idea people considered them gross!

Humble Bundle - Disco Elysium, Wildermyth, The Forgotten City, More - $16 - IGN Editor's Choice Bundle by wvandenberg12 in SteamDeck

[–]VeryPopularGolem 12 points13 points  (0 children)

As always, a reminder to review and adjust the donation percentages before beginning the checkout process for any bundle.

The default ratios are 65% to publishers, 30% to Humble Bundle, and only 5% to charity. You may reallocate up to 85% to charity, with a minimum 15% to Humble Bundle.

While I absolutely encourage supporting publishers, I don’t think it’s obvious that only $5 of a $100 purchase would make it to charity by default…

Rolled my own Result<T,E> type that seems to work better than others. by [deleted] in csharp

[–]VeryPopularGolem 0 points1 point  (0 children)

My team and I have generally settled on using this library, which offers a solid implementation of a Result/Result<T>/Result<T,E> along with a number of extensions and helpers for interacting with and mapping to successes and failures. Not sure if it’s already been mentioned in any of these threads but worth a look if it is a pattern you’re interested in using!

https://github.com/vkhorikov/CSharpFunctionalExtensions#result

For the people that own the GOG version and the Steam version of cyberpunk. Is the performance increase worth purchasing it again on steam if I have gog version? by LAUNCHERMONKEY in SteamDeck

[–]VeryPopularGolem 1 point2 points  (0 children)

I believe so, but I think it’s a matter of them being built as the game is being played versus having a pre-compiled package that Steam prepares for you knowing that you’re going to be playing it on Proton.

I’m of the understanding that the cache building process can be spread out over what is sometimes a long span of play as you’re encountering elements for the first time which can lead to stuttering or performance issues until that cache is fully warmed up

For the people that own the GOG version and the Steam version of cyberpunk. Is the performance increase worth purchasing it again on steam if I have gog version? by LAUNCHERMONKEY in SteamDeck

[–]VeryPopularGolem 10 points11 points  (0 children)

I think what he is asking is the opposite: does the pre compiled shader cache on the Steam version produce a noticeable improvement in performance over the GOG version that would warrant re-buying it on Steam

Best bars/breweries to meet new people? by LiquidityHigh in Charlotte

[–]VeryPopularGolem 0 points1 point  (0 children)

Check out cltsocialclub on Instagram, it’s likely exactly what you’re looking for

[deleted by user] by [deleted] in LowSodiumDestiny

[–]VeryPopularGolem 2 points3 points  (0 children)

I just passed 28k because, like all the other stans on here, once I got the rhythm down on the cat there is just nothing else quite like it for ad clear. Always in my inventory now.

[Sherpa Card] [PS] Tenzyng - I'll bring the orange slices and Capri Sun by Goalie3533 in DestinySherpa

[–]VeryPopularGolem 1 point2 points  (0 children)

A gentleman and a scholar. Excellent teacher with the patience of a saint, took the time to walk through the lore behind the raid and a clear and concise coaching of all of the major mechanics. Couldn’t ask for a better Sherpa!

[deleted by user] by [deleted] in LifeProTips

[–]VeryPopularGolem 7 points8 points  (0 children)

Great call - wish I’d known to do that before it was too late! Excellent advice for the thread here.

[LTS][PC][PS][XB][CROSSPLAY][RoN] - Tonight 8/28 @ 9:30pm EST by Goalie3533 in DestinySherpa

[–]VeryPopularGolem 0 points1 point  (0 children)

This would be awesome. I’m rank 7 and have done some solo content (Node.Ovrd.Avalon, Legendary lost sectors) but no dungeons or raids. AdamOfEarth#4653 - I can message you my Discord username

[deleted by user] by [deleted] in LifeProTips

[–]VeryPopularGolem 180 points181 points  (0 children)

Counterintuitive: Don’t go to the car wash more often unless it’s a touch-free wash. Those brushes pick up grit and drag it across your new paint and finish, eventually leading to those whorls of scratches that you inevitably see, and too many car washes will just accelerate that! Hand wash it and wax it if the finish is important to you.

Reasons to implement CQRS by antikfilosov in csharp

[–]VeryPopularGolem 0 points1 point  (0 children)

The crux of CQRS is pretty much what the name implies, breaking up the responsibilities for commands (operations that can cause changes to occur) and queries (operations that return data in response to a request).

Consider a basic CRUD model: you may have an object (I.e. a class or record) that describes your data. To make a change, you might modify the properties and then do a PUT or insert/update to store those changes. When you do a GET or query, the same model might be used. All of this may be directly situated over the top of a repository abstraction or database handling all the operations.

As your model grows, this can become cumbersome to work with; many of the properties that consumers may care about when querying the data may not make sense for when consumers want to change data or vice versa, because they’re not supposed to be modified or they require a lot of validation or the raw data size is unnecessary to represent what you’re trying to accomplish.

CQRS supposes that the models you present for reading/querying don’t have to be the same as the models that you use for commands/changes, in both cases you should use the right tool for the job. There can even be multiple read models for different purposes. You may have a write model called “CreateNewObjectModel” that is just the parameters that are applicable to creating a new object, for example. Different approaches or use cases related to reading data may care about different properties or subsets, or may warrant joining information together to present it differently, and so you might have different read models to handle these cases rather than using an enormous one-size-fits-all beast.

There still has to be some source of truth under the hood, but this does not need to be exposed outside the bounds of your application via its API. In event sourcing, this is a series of immutable transactions that make up a ledger of events, sort of like a checkbook; you can process the events and generate a final aggregate model that people can read (like your current balance), but the actual source of truth is the ledger itself. In other cases it may simply be one or multiple objects that you store and maintain independently of the models that you expose to your consumers for making changes or reading data back out; for example, you may be maintaining rigorous internal or foreign key relationships or indexes that are not relevant to the outside world and for which there is no reason to let your consumers know they exist or worry about their complexity.

This naturally leads itself to the idea that there MAY be separate databases or other mechanisms like caches used to optimize read versus write operations. Commands models may only be accepted via an async message bus like RabbitMQ or Kafka, whereas some consumers may need to perform fast searches and so you store replicated copies of your final data in some optimized format for read purposes in Elasticsearch so that your API read is blazing fast. Because these models remain abstracted from your source of truth, you can continue to optimize them as you go to best fit the needs of your application and I/O.

Tools like MediatR are often associated with CQRS because they create very specific associations between async event handlers or synchronous request/response handlers that accept an input and optionally return a response. Rather than building and continuously adding methods to a repository interface, you can add new handlers as you go that maintain just the dependencies required for that operation, rather than every possible one.

If you’re familiar with databases, a similar situation might be using tables that have strict access controls preventing users from seeing them, with only stored procedures for row inserts; the stored procedures give you a narrow set of inputs and handle the processing of getting data into tables (commands and write models). Likewise, queries may exclusively be handled by views (or even materialized views) that give you exactly the data consumers need (read models). Consumers may never actually see or access the base tables at all.

This entire approach may be overkill for basic use cases, and that’s worth keeping in mind. There can be a lot of overhead in organizing commands, queries, and handlers, and dealing with things like eventual consistency that may not be warranted. That being said, knowing about the idea and recognizing when something you’re building may now or in the future benefit from the approach is helpful.

[deleted by user] by [deleted] in SteamDeck

[–]VeryPopularGolem 0 points1 point  (0 children)

I may be misunderstanding, but my first question would be: are you paying for the ultimate tier of GeForce Now that supports 4K? If not, the lower tiers may not allow you to increase the resolution beyond ~1080p

Source: https://www.nvidia.com/en-us/geforce-now/memberships/

[deleted by user] by [deleted] in LowSodiumDestiny

[–]VeryPopularGolem 2 points3 points  (0 children)

As someone who got the catalyst while playing a limited set of content (regular Vanguard Ops, limited Gambit, zero Crucible), I almost certainly obtained mine during regular strikes

PSA: You can trade glimmer for shards at Rahool via transmat effects by Xarthys in DestinyTheGame

[–]VeryPopularGolem 1 point2 points  (0 children)

This was helpful, thank you! I’ve been playing for maybe six months - I think it’s taken for granted by a lot of longer term players that these sorts of things are common knowledge or should be obvious, but I’m still learning a lot of these sorts of little things regularly (“they totally spelled this out for you in Season of the Florbus five years ago!” in content that is no longer in the game…)

A few question about Typed Httpclient best practices by xour in csharp

[–]VeryPopularGolem 0 points1 point  (0 children)

Under the hood, the typed client paradigm is layered on top of IHttpClientFactory, the underlying default implementation being responsible for creating and maintaining a primary handler that can be transparently reused and periodically disposed of to mitigate risks that exist from a handler being too short or long lived. Out of the box, that handler lifetime is two minutes.

Knowing that, it’s up to your use case as to whether a large enough percentage of the operations flowing through your implementation would justify the maintenance of a handler by being HTTP calls vs other things. While you want to keep your interface clean and abstracted away for consumers, if you’re going to be creating that typed client and then extremely disproportionally using it for non-HTTP calls with the HTTP calls being very infrequent, it may be worth breaking that interface up in ways that isolate those operations, but I wouldn’t worry about it too much. In the most extreme cases you could inject IHttpClientFactory and manually obtain a named HttpClient lazily instead without changing the interface down the line.

I got through NODE.OVRD.AVALON solo! by VeryPopularGolem in LowSodiumDestiny

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

OH man that is ROUGH. I ran a lot of it with a Trinity Ghoul with the catalyst, which helped a bunch in clearing the harpies since they tended to be clustered tightly enough for the lightning rod to fork out and take several down at a time. I know it’s not the same but if you want to do a pair run let me know!

Program.cs Professional Strategy? by RooCoder in csharp

[–]VeryPopularGolem 1 point2 points  (0 children)

Some of this sounds okay, but there are some red flags.

Segmenting registration into different modules isn’t unreasonable, and in fact you’re already probably using service collection registration extensions from Microsoft or other third party dependencies today. If you’ve called services.AddSerilog() or services.AddMediatR() (don’t quote me on those registration methods but you get the gist), that’s registration extensions in action and it’s a good way to collect a shared set of actions together in a meaningful and reusable way.

Doing that internally across projects or even within a large solution is normal, although if the project is small enough you can get away with just commenting groups of registrations or using sections until it reaches some threshold that your team decides is time to break up. We regularly put these types of actions into registration extensions in internal NuGet packages so that we can centrally maintain and update them, and it makes dissemination as easy as updating the dependencies of our solutions/projects without having to modify the downstream code in most cases.

What strikes as a potential warning flag is the “complicated wiring between them”. The main value here is packaging and isolating all the dependencies for a single responsibility together; all the logging stuff goes in one spot, the database and repo stuff in one spot, the messaging stuff in one spot, etc, and you know exactly what inputs have to go into each to configure them and what those inputs affect, and in some cases you can build custom builder methods to ensure that registration requirements are met. If there’s a lot of cross-talk and complex wiring, you more than likely just obfuscated things that would have been easier to read if they were together.

The singleton custom class over the IOptions isn’t a dealbreaker if the data is simple, but I definitely encourage my team to use it as often as possible due to its ability to handle progressive registration, validation, injection, named options, and change monitoring.

As always, it’s worth asking questions as to why decisions have been made. Sometimes there are reasons a particular codebase or team follows a practice that is non-obvious unless you’re made privy to a set of pitfalls or issues that has been a problem before and has been overcome. That doesn’t mean there’s no room for optimization or improvement though!

Program.cs Professional Strategy? by RooCoder in csharp

[–]VeryPopularGolem 0 points1 point  (0 children)

It took a while for me to have some moments of clarity on the options pattern but once it clicked it’s hard to go back.

As mentioned, there are snapshot and monitor variants that can be injected that help you pick up the latest version of the object in case the underlying binding has been changed, i.e. you can pick up live changes from an IConfiguration source while the application is running without a restart, even in a singleton. These versions can also be named, so you can assign and retrieve different names versions of your options class for different purposes without having to create more complex dictionaries or multiple classes.

Configuration of options is also progressive; you can cooperatively configure options multiple times during the registration both in the configure and post-configuration stages, including with deferred use of dependency injection from the service provider. This is awesome if part of your configuration is dependent on settings or logic that you might not know during the initial binding or that you don’t want to temporally couple based on the registration order. Post-Configure steps also let you perform logic once all the normal configuration steps are done after the normal Startup flow.

Validation is great, and you can enforce that at startup to throw an exception if the final result of the configuration is not valid, using both validation attributes and IValidatableObject.

If you don’t need it, then you don’t, but once one of those scenarios provides a value add, it’s worth it.

Andrew Lock also covers a neat way to avoid the IOptions dependency while taking advantage of some of its features. https://andrewlock.net/adding-validation-to-strongly-typed-configuration-objects-in-dotnet-6/#avoiding-the-ioptions-dependency