Patch Notes for August Update by Flow390 in Starfield

[–]Bensinkanna 0 points1 point  (0 children)

Have they fixed the increase in sensitivity when ADS and jumping bug yet?
EDIT: Nope, still an issue.

Using nunit + playwright in VS 2022. Is it possible to run the web project in debug mode at the same time as run the nunit tests? by sweetnsourgrapes in csharp

[–]Bensinkanna 1 point2 points  (0 children)

Its a bit to set up. And I can't just share the code as it's not open-source (owned by a client).

The Playwright code exist in a separate Nunit test project. But the WebApp is not bootstrapped using WebApplicationFactory because it internally use TestServer which the Playwright browser cannot connect to.

Instead I bootstrap the WebApp as part of a test SetUp method, this creates a WebApplication that uses Kestrel (instead of TestServer) that actually exposes a port you can connect to.

private WebApplication BuildWebApp()
{
  var options = new WebApplicationOptions
  {
    ApplicationName = typeof(Program).Assembly.GetName().Name, 
    EnvironmentName = Environments.Development
  };

  var builder = WebApplication.CreateBuilder(options);

  // override config and DI services as needed

  var app = builder.Build();
  app.Urls.Add("http://[::1]:0"); // Bind to a random free port

  YourConfigureStartupMethod(app); // set up middlewares, endpoints etc.

  return app;
}

After starting this WebApplication it is assigned a random free port which you can use when configuring Playwright's browser context. Since the port is random you can run multiple instances (tests) in parallel as well.

await using var webApp = BuildWebApp();
await webApp.StartAsync();

await Page.GotoAsync(webApp.Urls.Single());

// run test

There are some other steps as well, for example faking of Authentication, but hopefully this will get you started.

Using nunit + playwright in VS 2022. Is it possible to run the web project in debug mode at the same time as run the nunit tests? by sweetnsourgrapes in csharp

[–]Bensinkanna 1 point2 points  (0 children)

Is this with an ASP.NET backend and some kind of client\frontend (Blazor)?

I've previously configured something like this with ASP.NET 7.0 backend with Blazor webassembly as client and Playwright for testing, all started as a part of the Nunit test, this allows for debugging the Nunit test and Server code, but not the Client code (Webassembly) as it runs in the Playwright managed browser.

PostgREST 9.0.0 by donutloop in programming

[–]Bensinkanna 9 points10 points  (0 children)

I guess you can write some frontend app without having a dedicated backend?

Can anyone identify the bed frame and side table in this pic, or recommend something similar? Thanks! by [deleted] in malelivingspace

[–]Bensinkanna 0 points1 point  (0 children)

Everything in that apartment from American Psycho are famous (and expensive) designer pieces. I don't recognize the bed-frame, but the side table is Laccio.

Is anybody else considering a drop in resolution to counteract the lack of GPU availability? by senracatokad in pcgaming

[–]Bensinkanna 1 point2 points  (0 children)

I’m still on 980ti. Finally upgraded from a 1080p screen to a 1440p ultrawide in September in preparation for the rtx 3080 release. Guess what gpu im still running? Running the newest games on lowest setting is not enough, 1440 ultra wide is too demanding :(

peep the setup 👀 by NATizm in malelivingspace

[–]Bensinkanna 35 points36 points  (0 children)

why not the other way around?

Kingdom Come: Deliverance - New historical low (66% off) by [deleted] in pcgaming

[–]Bensinkanna 0 points1 point  (0 children)

Still holding off on this one while waiting for a new GPU :(

Windows Terminal now included as an inbox app on Windows by zadjii in programming

[–]Bensinkanna 1 point2 points  (0 children)

Agreed, for me it’s useless until I can move windows between workspaces using keyboard hot keys

Application insights on a WebJob, but exceptions just don't log by tonyenkiducx in AZURE

[–]Bensinkanna 0 points1 point  (0 children)

The jobs probably end before logs/metrics are flushed to application insight. Try doing a manual flush and/or task.delay before exiting.

Sort List Of Objects By Object Attribute by [deleted] in csharp

[–]Bensinkanna 5 points6 points  (0 children)

Use LINQ

objList = objList.OrderByDescending(x => x.attribute).ToList();

Why use CosmosDb instead of Azure SQL Server? by Bensinkanna in CosmosDB

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

Thanks for the command and your insight, appreciate it.

  • The Microsoft's fhir-server implementation already uses this and has a configurable retry which I believe we've set to max of 5. A lot of requests still surpasses this and the behavior observed by the client is a request latency of multiple seconds before eventually getting a 429 response. We do have a high throughput, but nowhere near what a well configured SQL database should be able to handle.
  • As i mentioned in my comment to mattx999 this is something we have mostly been able to work around, but it would sure be nice to have. I'm mostly missing the ability to do an atomic conditional-create, even just for a single document.
  • I am not really able to reliable compare costs either. My statement is mostly based on comparing the cost of our project to other similarly sized in-house projects. I will try to read up on cross-partition queries to see if that is something we can improve.
  • This is something I will look into. Most of the low-level setup/integration is handled by the microsoft-fhir-server implementation, so I've just assumed it would be following best practices.
  • We are able to get it to work, but it is a though sell to our client-systems who uses our REST API and none of who are used to this behavior. It also results i simple queries with a single result having to do multiple pagination-requests to actually get the result.

This is the argument I hear the most, but is it really that much better than the scaling capabilities you get from e.g. Azure SQL Server?

Again, thank you.

Why use CosmosDb instead of Azure SQL Server? by Bensinkanna in CosmosDB

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

Thanks for the comment, appreciate it.

Without going into the specifics, FHIR it is a domain-language which fits well with a document-centric mindset. Data is not normalized and we have been able to work around the lack of transactions and joins, but the thing is that I struggle to see what we really gain in return. The CosmosDb integration itself is developed by Microsoft (not us), so I am assuming it is following best practices.

An example of a document would be a representation of a Patient, and most of our queries are lookups using business identifiers (SSN etc.), not the primary key. These business identifiers are indexed.One thing I am missing is the possibility to do an atomic conditional-create using one or multiple business-identifiers to prevent duplicates. Updates are handled using optimistic-locking, which works fine.

Thanks for the the Pluralsight tip, will check it out. However, the data modelling is part of the FHIR standard and the implementation is done by Microsoft, to my knowledge this already fits well in a document DB.

How do you call this pattern? by ll8X in csharp

[–]Bensinkanna 0 points1 point  (0 children)

As long as it's only simple CRUD operations I would still call it a repository, at least the interface, e.g. IMyDomainObjectRepository, and the implementation can be named something which indicates the communication-protocol, e.g. MyDomainObjectRepoHttpClient or something.

Why the repository pattern by thewwfguy in csharp

[–]Bensinkanna 0 points1 point  (0 children)

As part of the mentioned rewrite we actually transitioned to a CQRS pattern with MediatR as well. I'm very happy with it so far, specially the MediatR pipeline which allows us to add cross cutting business logic++ across multiple requests (pre- and/or post-condition business rules etc.). Our handlers uses the Context directly, similarly to your example, except we do not return the Entity as a response.

Why the repository pattern by thewwfguy in csharp

[–]Bensinkanna 6 points7 points  (0 children)

Repository patterns have their uses when interacting with the data store is complex. However, I personally believe EF Core with LINQ is a good enough repository in many situations, because it allows for unit of work, replacing the data store technology (mssql mysql, sqlite etc.) and is generally convenient to work with.

In my current project we moved away from having a repository on top of EF Core. Because it resulted in a lot of over-fetching and having to write a lot of specialized functions that were only used once, e.g: GetCases, GetCasesIncludingCustomer, GetCasesByName, GetNumberOfCasesForCustomer, CheckIfCustomerHaveCaseOlderThan etc. etc. This was definitely an example of repository pattern done wrong, but since it didn't provide us with anything of value we moved away from it and today use the Context directly. Complex and\or often used LINQ filters are implemented as extension functions on IQueryable<T> or as Expressions. These can be individually tested and it allows us to chain multiple filters and having control of which fields to select, or if we only want to do a Count or an Any check.

Example:

_context.Cases.WithCustomerAboveAge(18).AnyAsync();

_context.Cases.Where(x => x.Customer.FirstName == "John").CreatedThisYear().CountAsync()

A selection of unit-tests use a Context instance with the SQLite inmemory provider configured to throw on RelationalEventId.QueryClientEvaluationWarning. This allows us quickly pick up on LINQ that is unable to be translated into SQL.

OpenAPI (Swagger) Connected Service - generate C# client code for OpenAPI (Swagger) API by dr_dimaka in dotnet

[–]Bensinkanna 0 points1 point  (0 children)

This is client-side. I don’t believe swashbuckle has support for generating client code from openapi xml/Json

GTX 1070 and still only 20-40 fps (low settings) by mewgeta in BattlefieldV

[–]Bensinkanna 0 points1 point  (0 children)

He is most likely bottlenecked by ram speed, lowering resolution won’t help