/// <summary> /// Get entity using specific GUID /// </summary> /// <param name="guid">Global Unique Identifier of the entity</param> /// <param name="parameters">parameters</param> /// <returns>Entity if exists. Null if entity not exists.</returns> public async Task <T> GetEntityAsync(string guid, string parameters) { if (guid.Contains('}') || guid.Contains('{')) { throw new Exception("Bad Guid: Guid cannot contain '}' or '{'"); } // Convert the resonse to an object of the specific type var response = await _conn.GetEntityAsync(_keyname, guid, parameters); response = ApiResponseCleaner.GetJsonObject(response); var ec = new EntityConverter(); var entity = ec.ConvertJsonToObject <T>(response); // If entity isn't managed already, add entity to EntityController AddEntityToManagedEntitiesCollection(entity); return(entity); }