private static async Task <Guid> GetExistingSpaceOrCreate(HttpClient httpClient, ILogger logger, Guid parentId, SpaceDescription description) { var existingSpace = await requests.FindSpace(httpClient, logger, description.name, parentId); return(existingSpace?.Id != null ? Guid.Parse(existingSpace.Id) : await requests.CreateSpace(httpClient, logger, description.ToSpaceCreate(parentId))); }
public static SpaceCreate ToSpaceCreate(this SpaceDescription description, Guid parentId) => new SpaceCreate() { Name = description.name, ParentSpaceId = parentId != Guid.Empty ? parentId.ToString() : "", };