예제 #1
0
 public static Models.SpaceCreate ToSpaceCreate(this SpaceDescription description, Guid parentId)
 => new Models.SpaceCreate()
 {
     Name          = description.name,
     ParentSpaceId = parentId != Guid.Empty ? parentId.ToString() : "",
 };
예제 #2
0
        private static async Task <Guid> GetExistingSpaceOrCreate(HttpClient httpClient, ILogger logger, Guid parentId, SpaceDescription description)
        {
            var existingSpace = await Api.FindSpace(httpClient, logger, description.name, parentId);

            return(existingSpace?.Id != null
                ? Guid.Parse(existingSpace.Id)
                : await Api.CreateSpace(httpClient, logger, description.ToSpaceCreate(parentId)));
        }