From 3436edbe6b0955d60518ce3431aed14e37cf60fd Mon Sep 17 00:00:00 2001 From: Simon Gockner Date: Tue, 11 Feb 2020 10:55:04 +0100 Subject: [PATCH] - make services disposable - add services to client interface --- GBase.Api/Services/IGBaseEntryService.cs | 3 ++- GBase.Api/Services/IGBaseService.cs | 3 ++- GBase.Api/Services/IGBaseTableService.cs | 3 ++- GBase.Client/GBaseClient.cs | 7 ++++--- GBase.Client/Interfaces/IGBaseClient.cs | 5 ++++- GBase.Server/Services/GBaseEntryService.cs | 6 +++++- GBase.Server/Services/GBaseService.cs | 6 ++++++ GBase.Server/Services/GBaseTableService.cs | 6 +++++- 8 files changed, 30 insertions(+), 9 deletions(-) diff --git a/GBase.Api/Services/IGBaseEntryService.cs b/GBase.Api/Services/IGBaseEntryService.cs index ea9a501..18e22c9 100644 --- a/GBase.Api/Services/IGBaseEntryService.cs +++ b/GBase.Api/Services/IGBaseEntryService.cs @@ -2,12 +2,13 @@ // Created: 2020-02-10 // Copyright(c) 2020 SimonG. All Rights Reserved. +using System; using System.ServiceModel; namespace GBase.Api.Services { [ServiceContract] - public interface IGBaseEntryService //TODO: Add OperationContracts for all operations this service has to do + public interface IGBaseEntryService : IAsyncDisposable //TODO: Add OperationContracts for all operations this service has to do { } diff --git a/GBase.Api/Services/IGBaseService.cs b/GBase.Api/Services/IGBaseService.cs index 3796122..f87ecfd 100644 --- a/GBase.Api/Services/IGBaseService.cs +++ b/GBase.Api/Services/IGBaseService.cs @@ -2,12 +2,13 @@ // Created: 2020-02-10 // Copyright(c) 2020 SimonG. All Rights Reserved. +using System; using System.ServiceModel; namespace GBase.Api.Services { [ServiceContract] - public interface IGBaseService //TODO: Add OperationContracts for all operations this service has to do + public interface IGBaseService : IAsyncDisposable //TODO: Add OperationContracts for all operations this service has to do { [OperationContract] bool AddTable(); diff --git a/GBase.Api/Services/IGBaseTableService.cs b/GBase.Api/Services/IGBaseTableService.cs index 29c0e25..1cec2d5 100644 --- a/GBase.Api/Services/IGBaseTableService.cs +++ b/GBase.Api/Services/IGBaseTableService.cs @@ -2,12 +2,13 @@ // Created: 2020-02-10 // Copyright(c) 2020 SimonG. All Rights Reserved. +using System; using System.ServiceModel; namespace GBase.Api.Services { [ServiceContract] - public interface IGBaseTableService //TODO: Add OperationContracts for all operations this service has to do + public interface IGBaseTableService : IAsyncDisposable //TODO: Add OperationContracts for all operations this service has to do { } diff --git a/GBase.Client/GBaseClient.cs b/GBase.Client/GBaseClient.cs index 5885fc4..1f61ca2 100644 --- a/GBase.Client/GBaseClient.cs +++ b/GBase.Client/GBaseClient.cs @@ -3,6 +3,7 @@ // Copyright(c) 2020 SimonG. All Rights Reserved. using System.Threading.Tasks; +using GBase.Api.Services; using GBase.Client.Interfaces; using GBase.Client.Services; @@ -18,9 +19,9 @@ namespace GBase.Client } - public GBaseService GBase { get; } - public GBaseTableService GBaseTable { get; } - public GBaseEntryService GBaseEntry { get; } + public IGBaseService GBase { get; } + public IGBaseTableService GBaseTable { get; } + public IGBaseEntryService GBaseEntry { get; } public async ValueTask DisposeAsync() diff --git a/GBase.Client/Interfaces/IGBaseClient.cs b/GBase.Client/Interfaces/IGBaseClient.cs index 3285b5c..b78387f 100644 --- a/GBase.Client/Interfaces/IGBaseClient.cs +++ b/GBase.Client/Interfaces/IGBaseClient.cs @@ -3,11 +3,14 @@ // Copyright(c) 2020 SimonG. All Rights Reserved. using System; +using GBase.Api.Services; namespace GBase.Client.Interfaces { public interface IGBaseClient : IAsyncDisposable { - + IGBaseService GBase { get; } + IGBaseTableService GBaseTable { get; } + IGBaseEntryService GBaseEntry { get; } } } \ No newline at end of file diff --git a/GBase.Server/Services/GBaseEntryService.cs b/GBase.Server/Services/GBaseEntryService.cs index 9b0a9bc..f9b8606 100644 --- a/GBase.Server/Services/GBaseEntryService.cs +++ b/GBase.Server/Services/GBaseEntryService.cs @@ -2,12 +2,16 @@ // Created: 2020-02-10 // Copyright(c) 2020 SimonG. All Rights Reserved. +using System.Threading.Tasks; using GBase.Api.Services; namespace GBase.Server.Services { public class GBaseEntryService : IGBaseEntryService { - + public async ValueTask DisposeAsync() + { + throw new System.NotImplementedException(); + } } } \ No newline at end of file diff --git a/GBase.Server/Services/GBaseService.cs b/GBase.Server/Services/GBaseService.cs index 3d636a2..826c0c6 100644 --- a/GBase.Server/Services/GBaseService.cs +++ b/GBase.Server/Services/GBaseService.cs @@ -2,6 +2,7 @@ // Created: 2020-02-10 // Copyright(c) 2020 SimonG. All Rights Reserved. +using System.Threading.Tasks; using GBase.Api.Services; namespace GBase.Server.Services @@ -17,5 +18,10 @@ namespace GBase.Server.Services { throw new System.NotImplementedException(); } + + public async ValueTask DisposeAsync() + { + throw new System.NotImplementedException(); + } } } \ No newline at end of file diff --git a/GBase.Server/Services/GBaseTableService.cs b/GBase.Server/Services/GBaseTableService.cs index c6d27e0..2c556c2 100644 --- a/GBase.Server/Services/GBaseTableService.cs +++ b/GBase.Server/Services/GBaseTableService.cs @@ -2,12 +2,16 @@ // Created: 2020-02-10 // Copyright(c) 2020 SimonG. All Rights Reserved. +using System.Threading.Tasks; using GBase.Api.Services; namespace GBase.Server.Services { public class GBaseTableService : IGBaseTableService { - + public async ValueTask DisposeAsync() + { + throw new System.NotImplementedException(); + } } } \ No newline at end of file