public async Task <ActionResult <ResponseResult> > Delete([FromBody] DatastoreRequestMessage request) { string datastoreName = request.datastoreName; if (datastoreName == dataLoader.GetCurrentDataStoreName()) { ResponseResult msg = new ResponseResult(); msg.success = false; msg.responseMessage = "Datastore " + datastoreName + " is the default datastore now. To delete it, you need to set other datastore as default one first.\n"; return(Ok(msg)); } if (!dataLoader.DeleteDataStore(datastoreName)) { ResponseResult msg = new ResponseResult(); msg.success = true; msg.responseMessage = "Datastore " + datastoreName + " doesn't exist. You don't need to delete it.\n"; return(Ok(msg)); } else { ResponseResult msg = new ResponseResult(); msg.success = true; msg.responseMessage = "Datastore " + datastoreName + " have been deleted.\n"; return(Ok(msg)); } }