From 7594a16e38304739487b053405153379faee6e58 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 7 Jan 2021 16:23:20 +0800 Subject: 史诗级重构! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BackEnd/Timeline/Services/BasicTimelineService.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'BackEnd/Timeline/Services/BasicTimelineService.cs') diff --git a/BackEnd/Timeline/Services/BasicTimelineService.cs b/BackEnd/Timeline/Services/BasicTimelineService.cs index 0d9f64a9..be500135 100644 --- a/BackEnd/Timeline/Services/BasicTimelineService.cs +++ b/BackEnd/Timeline/Services/BasicTimelineService.cs @@ -15,6 +15,13 @@ namespace Timeline.Services /// public interface IBasicTimelineService { + /// + /// Check whether a timeline with given id exists without getting full info. + /// + /// The timeline id. + /// True if exist. Otherwise false. + Task CheckExistence(long id); + /// /// Get the timeline id by name. /// @@ -67,6 +74,11 @@ namespace Timeline.Services }; } + public async Task CheckExistence(long id) + { + return await _database.Timelines.AnyAsync(t => t.Id == id); + } + public async Task GetTimelineIdByName(string timelineName) { if (timelineName == null) -- cgit v1.2.3