Added endpoint and functionality for getting, retrieving and deleting bookmarks, and for adding and removing tags for a bookmark

This commit is contained in:
Carl Tibule
2023-01-28 00:48:48 -06:00
parent 08823de474
commit b9cd6b3c6a
34 changed files with 1148 additions and 42 deletions

View File

@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YABA.Models;
namespace YABA.Data.Extensions
{
public static class UsersDbSetExtensions
{
public static async Task<bool> UserExistsAsync(this DbSet<User> userDbSet, int userId)
{
return await userDbSet.AnyAsync(x => x.Id == userId);
}
public static bool UserExists(this DbSet<User> userDbSet, int userId)
{
return userDbSet.Any(x => x.Id == userId);
}
}
}