public static async Task <TodoItem> CreateItemAsync(TodoItem item) { if (item.Id == null) { item.Id = Guid.NewGuid().ToString(); } return(await items.CreateItemAsync <TodoItem>(item.Category, item)); }
/// <summary> /// Create the Product Record /// </summary> /// <param name="item"></param> /// <returns></returns> public static async Task <ProductInfo> CreateProductAsync(ProductInfo item) { if (item.Id == null) { item.Id = Guid.NewGuid().ToString(); } // the CategoryName is the partition key return(await items.CreateItemAsync <ProductInfo>(item.CategoryName, item)); }