aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Services/BasicTimelineService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'BackEnd/Timeline/Services/BasicTimelineService.cs')
-rw-r--r--BackEnd/Timeline/Services/BasicTimelineService.cs12
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)