42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
using ModVersionChecker.managers.interfaces;
|
|
using ModVersionChecker.model;
|
|
using ModVersionChecker.repository.api.dto;
|
|
using ModVersionChecker.service.interfaces;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ModVersionChecker.service
|
|
{
|
|
public class StateService: IStateService
|
|
{
|
|
private List<App> apps = new List<App>();
|
|
private List<SourceResponse> sources = new List<SourceResponse>();
|
|
private List<TypeResponse> types = new List<TypeResponse>();
|
|
private Config config = new Config();
|
|
private readonly IAppRepository _appRepository;
|
|
|
|
public StateService(
|
|
IAppRepository appRepository
|
|
) {
|
|
_appRepository = appRepository;
|
|
}
|
|
|
|
public List<App> GetApps() => apps;
|
|
public void SetApps(List<App> apps) => this.apps = apps;
|
|
public List<SourceResponse> GetSources() => sources;
|
|
public void SetSources(List<SourceResponse> sources) => this.sources = sources;
|
|
public List<TypeResponse> GetTypes() => types;
|
|
public void SetTypes(List<TypeResponse> types) => this.types = types;
|
|
public Config GetConfig() => config;
|
|
public void SetConfig(Config config) => this.config = config;
|
|
|
|
|
|
public void UpdateApps() => this.apps = _appRepository.Load();
|
|
|
|
|
|
}
|
|
}
|