using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Bit.App.Abstractions; using Bit.App.Models.Data; namespace Bit.App.Repositories { public class SiteRepository : Repository, ISiteRepository { public SiteRepository(ISqlService sqlService) : base(sqlService) { } public Task> GetAllByUserIdAsync(string userId) { var sites = Connection.Table().Where(f => f.UserId == userId).Cast(); return Task.FromResult(sites); } public Task> GetAllByUserIdAsync(string userId, bool favorite) { var sites = Connection.Table().Where(f => f.UserId == userId && f.Favorite == favorite).Cast(); return Task.FromResult(sites); } } }