Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve multiple project support #39

Open
PeterIttner opened this issue Mar 1, 2022 · 0 comments
Open

Improve multiple project support #39

PeterIttner opened this issue Mar 1, 2022 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@PeterIttner
Copy link
Member

At the moment there is really only one project integration supported.

With one instance of ICalingaService you can only access one calinga project, because it has its configured API token and project settings.

You could for sure instantiate multiple ICalingaService-instances with different backing configurations, when creating them by hand. But this raises the question how to deal with dependency injection and .AddSingleton() as mentioned in the documentation for ASP.NET core integration.

It would be helpful, when either the documentation would be updated for supporting multiple project or the .NET SDK itself would have a way of supporting different project-configurations at runtime.

Sth like:

var projectA = calinga.Team("Team A").Project("Project A")
  .WithAPIToken("***")
  .WithDrafts(true)
  .WithCacheInterval(30);

var translatedA = await projectA.GetTranslationsAsync("my-key");

// and for supporting current appsettings-configuration:

var projectB = calinga.Team("Team A").Project("Project B")
  .WithConfiguration(nameof(CalingaServiceSettings));

var translatedB = await projectB.GetTranslationsAsync("my-key");
@PeterIttner PeterIttner added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 1, 2022
@PeterIttner PeterIttner changed the title Multiple project support Improve multiple project support Mar 1, 2022
@felixse felixse removed their assignment May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants