using System; using System.Collections.Generic; using System.Threading.Tasks; using Bit.App.Abstractions; using Bit.App.Models.Data; using Newtonsoft.Json; namespace Bit.App.Repositories { public class SettingsRepository : Repository, ISettingsRepository { public SettingsRepository(ISqlService sqlService) : base(sqlService) { } public Task>> GetEquivablentDomains(string userId) { var equivalentDomainsJson = Connection.Table().Where(f => f.Id == userId) .Select(f => f.EquivalentDomains).FirstOrDefault(); if(string.IsNullOrWhiteSpace(equivalentDomainsJson)) { return Task.FromResult>>(null); } var equivalentDomains = JsonConvert.DeserializeObject>>(equivalentDomainsJson); return Task.FromResult(equivalentDomains); } } }