/// <inheritdoc /> public IModule GetModule(ModuleIdentity moduleIdentity) { if (!IsModuleRegistered(moduleIdentity)) { return(null); } return(ModuleDtoFileSystem.ReadFromDirectory(Path.Combine(BasePath, moduleIdentity.ToString())).Unwrap().Result); }
/// <inheritdoc /> public void RemoveModule(ModuleIdentity moduleIdentity) { if (!IsModuleRegistered(moduleIdentity)) { throw new ArgumentException($"Module {moduleIdentity} wasn't registered"); } Directory.Delete(Path.Combine(BasePath, moduleIdentity.ToString()), true); }
private bool IsModuleRegistered(ModuleIdentity moduleIdentity) { return(Directory.Exists(Path.Combine(BasePath, moduleIdentity.ToString()))); }