From ef163726a5444ba0cbc631f74730184172c1c486 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 13 May 2021 15:05:53 +0300 Subject: Implemented BaseService that uses generics to implement very basic CRUD; Moved away from 3 service model to 1 service model in add feature script --- ExamTemplate/Services/Interfaces/IBaseService.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ExamTemplate/Services/Interfaces/IBaseService.cs (limited to 'ExamTemplate/Services/Interfaces/IBaseService.cs') diff --git a/ExamTemplate/Services/Interfaces/IBaseService.cs b/ExamTemplate/Services/Interfaces/IBaseService.cs new file mode 100644 index 0000000..55500ff --- /dev/null +++ b/ExamTemplate/Services/Interfaces/IBaseService.cs @@ -0,0 +1,21 @@ +using System; +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace ExamTemplate.Services.Interfaces +{ + public interface IBaseService + where DbModel : class + where ServiceModel : class + { + Task CreateAsync(ServiceModel serviceModel); + + Task GetByIdAsync(Guid id); + + Task> GetAll(); + + Task EditAsync(ServiceModel serviceModel); + + Task DeleteAsync(Guid id); + } +} -- cgit v1.2.3