示例#1
0
        public static async Task <List <Inventory> > DeserializeListForUserWithClient(this InventoryList list, string user, IDurableOrchestrationClient client)
        {
            var result = new List <Inventory>();

            list.RestoreLists();
            foreach (var item in list.InventoryList)
            {
                var id        = user.AsEntityIdFor <Inventory>(item);
                var inventory = await client.ReadEntityStateAsync <Inventory>(id);

                if (inventory.EntityExists)
                {
                    result.Add(inventory.EntityState);
                }
            }
            return(result);
        }