Skip to content

Conversation

@ebrob
Copy link
Contributor

@ebrob ebrob commented Jul 7, 2025

There are some use cases where an initializer isn't the best way to initialize.

Copy link
Owner

@Arkobat Arkobat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense with a factory method, but we should probably use the IHttpClientFactory to create the client.

@Arkobat
Copy link
Owner

Arkobat commented Jul 8, 2025

Looks good 👍
We should probably also inject the ILocalazyFactory when injecting the ILocalazyService
.AddScoped<ILocalazyFactory, LocalazyFactory>();

And add a unit tests that verifies we can use the LocalazyFactory.CreateService in practices

…sure the ListProjects call works when creating the service via factory.
@ebrob
Copy link
Contributor Author

ebrob commented Jul 8, 2025

@Arkobat I added a simple unit test that just ensures it can get the list of projects, so it works with my API key. Obviously I can't run your other tests since I don't have a key in your Localazy account.

@Arkobat
Copy link
Owner

Arkobat commented Jul 8, 2025

That is perfect @ebrob
I just ran them locally, and it works as intended.

@Arkobat Arkobat merged commit 63a0bf4 into Arkobat:master Jul 8, 2025
1 check passed
@ebrob ebrob deleted the rob/added-factory branch July 8, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants