Theme Viewer + Theme Updater (#2952)
This commit is contained in:
parent
24302d4fcc
commit
38e7c1c131
35 changed files with 4563 additions and 284 deletions
|
@ -19,6 +19,8 @@ public interface ISiteThemeRepository
|
|||
Task<SiteThemeDto?> GetThemeDtoByName(string themeName);
|
||||
Task<SiteTheme> GetDefaultTheme();
|
||||
Task<IEnumerable<SiteTheme>> GetThemes();
|
||||
Task<SiteTheme?> GetTheme(int themeId);
|
||||
Task<bool> IsThemeInUse(int themeId);
|
||||
}
|
||||
|
||||
public class SiteThemeRepository : ISiteThemeRepository
|
||||
|
@ -88,6 +90,19 @@ public class SiteThemeRepository : ISiteThemeRepository
|
|||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<SiteTheme> GetTheme(int themeId)
|
||||
{
|
||||
return await _context.SiteTheme
|
||||
.Where(t => t.Id == themeId)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> IsThemeInUse(int themeId)
|
||||
{
|
||||
return await _context.AppUserPreferences
|
||||
.AnyAsync(p => p.Theme.Id == themeId);
|
||||
}
|
||||
|
||||
public async Task<SiteThemeDto?> GetThemeDto(int themeId)
|
||||
{
|
||||
return await _context.SiteTheme
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue