diff options
author | crupest <crupest@outlook.com> | 2021-01-07 16:23:20 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-01-07 16:23:20 +0800 |
commit | 7594a16e38304739487b053405153379faee6e58 (patch) | |
tree | bb99d1a24fffc9c4142219b9c25dc66e3d2b60d2 /BackEnd/Timeline/Services/BasicTimelineService.cs | |
parent | 97e094c97dc9ed79cf7daa0a93568e1933015bdd (diff) | |
download | timeline-7594a16e38304739487b053405153379faee6e58.tar.gz timeline-7594a16e38304739487b053405153379faee6e58.tar.bz2 timeline-7594a16e38304739487b053405153379faee6e58.zip |
史诗级重构!
Diffstat (limited to 'BackEnd/Timeline/Services/BasicTimelineService.cs')
-rw-r--r-- | BackEnd/Timeline/Services/BasicTimelineService.cs | 12 |
1 files changed, 12 insertions, 0 deletions
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 @@ -16,6 +16,13 @@ namespace Timeline.Services public interface IBasicTimelineService
{
/// <summary>
+ /// Check whether a timeline with given id exists without getting full info.
+ /// </summary>
+ /// <param name="id">The timeline id.</param>
+ /// <returns>True if exist. Otherwise false.</returns>
+ Task<bool> CheckExistence(long id);
+
+ /// <summary>
/// Get the timeline id by name.
/// </summary>
/// <param name="timelineName">Timeline name.</param>
@@ -67,6 +74,11 @@ namespace Timeline.Services };
}
+ public async Task<bool> CheckExistence(long id)
+ {
+ return await _database.Timelines.AnyAsync(t => t.Id == id);
+ }
+
public async Task<long> GetTimelineIdByName(string timelineName)
{
if (timelineName == null)
|