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 CipherRepository : Repository, ICipherRepository { public CipherRepository(ISqlService sqlService) : base(sqlService) { } public Task> GetAllByUserIdAsync(string userId) { var ciphers = Connection.Table().Where(l => l.UserId == userId).Cast(); return Task.FromResult(ciphers); } public Task> GetAllByUserIdAsync(string userId, bool favorite) { var ciphers = Connection.Table().Where(l => l.UserId == userId && l.Favorite == favorite) .Cast(); return Task.FromResult(ciphers); } } }