public virtual IActionResult PostCreateClient([FromBody] RequestedClientInformation requestedClient) { if (requestedClient == null) { return(StatusCode((int)HttpStatusCode.BadRequest)); } Guid clientGuid; if (!Guid.TryParse(requestedClient.Uid, out clientGuid)) { clientGuid = Guid.NewGuid(); } ClientInformation client = new ClientInformation() { FhirServerUrl = requestedClient.FhirServerUrl, Uid = clientGuid, }; //// check for a UID //if ((client.Uid == null) || // (client.Uid == Guid.Empty)) //{ // // add a guid // client.Uid = Guid.NewGuid(); //} ClientManager.AddOrUpdate((Guid)client.Uid, client.FhirServerUrl); // return our data (so the client has the UID) return(StatusCode((int)HttpStatusCode.Created, client)); }