public Result <TModel> Get() { var result = Repository.Get(); if (result.IsSuccess) { return(EntityToModel(result.Data)); } return(new ErrorResult <TModel>("Entity doesn't exist.")); }
public override void Shutdown() { var result = _settingsRepository.Get(); if (result.IsSuccess) { _entityLoader.WriteToFile(result.Data, SettingsFile); } }
public Result <SoundCloudAuthenticationStateEnum> Logout() { var result = _clientInfoRepository.Get(); if (!result.IsSuccess) { _messenger.Send(new SoundCloudAuthenticationMessage(SoundCloudAuthenticationStateEnum.LoggedOut)); _client = null; Logger.Info("SoundCloudClientInfo missing. No Client initialization"); return(new ErrorResult <SoundCloudAuthenticationStateEnum>(Localization.Messages.CouldNotInitializeSoundCloudClient)); } _client = SoundCloudClient.CreateUnauthorized(result.Data.ClientId); Logger.Info("Unauthorized client initialized"); _messenger.Send(new SoundCloudAuthenticationMessage(SoundCloudAuthenticationStateEnum.LoggedInUnauthenticated)); return(new SuccessResult <SoundCloudAuthenticationStateEnum>(SoundCloudAuthenticationStateEnum.LoggedInUnauthenticated)); }