public async Task <IActionResult> SetNamespace(string ns) { try { // if (string.IsNullOrEmpty(ns)) // { HttpContext.Session.SetString("Namespace", ns); // } var namespaces = await _repository.GetNamespacesAsync(); return(View("Namespaces", SetDefaultNamespace(namespaces, ns))); } catch (Exception) { return(StatusCode(500)); } }
public async Task <IActionResult> GetNamespacesAsync() { if (!ModelState.IsValid) { return(BadRequest()); } try { var namespaces = await _repository.GetNamespacesAsync(); return(Ok(namespaces)); } catch (Exception) { return(StatusCode(500)); } }