diff --git a/src/PinguApps.Appwrite.Client/Clients/AccountClient.cs b/src/PinguApps.Appwrite.Client/Clients/AccountClient.cs index 05ff9053..4d2d1459 100644 --- a/src/PinguApps.Appwrite.Client/Clients/AccountClient.cs +++ b/src/PinguApps.Appwrite.Client/Clients/AccountClient.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using PinguApps.Appwrite.Client.Clients; using PinguApps.Appwrite.Client.Internals; using PinguApps.Appwrite.Client.Utils; @@ -14,9 +15,9 @@ public class AccountClient : IAccountClient, ISessionAware { private readonly IAccountApi _accountApi; - public AccountClient(IAccountApi accountApi) + public AccountClient(IServiceProvider services) { - _accountApi = accountApi; + _accountApi = services.GetRequiredService(); } string? ISessionAware.Session { get; set; } diff --git a/src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs b/src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs index 8b4b12fd..3cd2791c 100644 --- a/src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs +++ b/src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs @@ -6,7 +6,7 @@ namespace PinguApps.Appwrite.Client.Internals; -public interface IAccountApi : IBaseApi +internal interface IAccountApi : IBaseApi { [Get("/account")] Task> GetAccount([Header("x-appwrite-session")] string? session); diff --git a/src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs b/src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs index efa53db2..984f68f6 100644 --- a/src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs +++ b/src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs @@ -8,6 +8,6 @@ namespace PinguApps.Appwrite.Client.Internals; "x-sdk-language: dotnet", "x-sdk-version: 0.0.1", "X-Appwrite-Response-Format: 1.5.0")] -public interface IBaseApi +internal interface IBaseApi { } diff --git a/src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs b/src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs index 5a5b0f2c..67b4105e 100644 --- a/src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs +++ b/src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs @@ -4,7 +4,7 @@ using Refit; namespace PinguApps.Appwrite.Server.Internals; -public interface IAccountApi : IBaseApi +internal interface IAccountApi : IBaseApi { [Post("/account")] Task> CreateAccount(CreateAccountRequest request); diff --git a/src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs b/src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs index 437e0c93..cffdc5ff 100644 --- a/src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs +++ b/src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs @@ -8,6 +8,6 @@ namespace PinguApps.Appwrite.Server.Internals; "x-sdk-language: dotnet", "x-sdk-version: 0.0.1", "X-Appwrite-Response-Format: 1.5.0")] -public interface IBaseApi +internal interface IBaseApi { } diff --git a/src/PinguApps.Appwrite.Server/Servers/AccountServer.cs b/src/PinguApps.Appwrite.Server/Servers/AccountServer.cs index 0c73395d..7279362f 100644 --- a/src/PinguApps.Appwrite.Server/Servers/AccountServer.cs +++ b/src/PinguApps.Appwrite.Server/Servers/AccountServer.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using PinguApps.Appwrite.Server.Internals; using PinguApps.Appwrite.Server.Utils; using PinguApps.Appwrite.Shared; @@ -11,9 +12,9 @@ public class AccountServer : IAccountServer { private readonly IAccountApi _accountApi; - public AccountServer(IAccountApi accountApi) + public AccountServer(IServiceProvider services) { - _accountApi = accountApi; + _accountApi = services.GetRequiredService(); } public async Task> Create(CreateAccountRequest request)