示例#1
0
        public async Task Add(Profile item)
        {
            ProfileItem profileItem = new ProfileItem
            {
                UserId             = item.UserId,
                Username           = item.UserName,
                PhotoBase64Encoded = item.PhotoBase64Encoded
            };

            profileItem = await SamplesUtils.InsertOrMergeEntityAsync(table, profileItem);
        }
示例#2
0
        public async Task <Profile> Get(string UserName)
        {
            ProfileItem pi = await SamplesUtils.RetrieveProfileAsync(table, "1", UserName);

            return(new Profile
            {
                UserId = "1",
                UserName = pi.Username,
                PhotoBase64Encoded = pi.PhotoBase64Encoded
            });
        }
示例#3
0
        public async Task Add(Item item)
        {
            TableItem tableItem = new TableItem
            {
                TeamId          = item.TeamId,
                MeetingDatePlus = item.MeetingDatePlus,
                Participation   = item.Participation,
                UserName        = item.UserName,
                Location        = item.Location,
                Activity        = item.Activity
            };

            tableItem = await SamplesUtils.InsertOrMergeEntityAsync(table, tableItem);
        }
示例#4
0
        public async Task <IEnumerable <Item> > GetAll()
        {
            List <Item> listItems = new List <Item>();
            // TODO: Get all items for a PartitionKey and a RowLey starting with a date (ex: "2019-12-01-blabla")
            //SamplesUtils.RetrieveEntityUsingPointQueryAsync(table, "28881b7a-d3e2-4eae-8687-0c4f4c5e6107", "2019-12-01").GetAwaiter().GetResult();
            var list = await SamplesUtils.GetList(table, "InternalPreview-0.0.1.0", null);

            foreach (TableItem item in list)
            {
                listItems.Add(new Item {
                    TeamId        = item.TeamId, MeetingDatePlus = item.MeetingDatePlus, UserName = item.UserName,
                    Participation = item.Participation, Activity = item.Activity, Location = item.Location
                });
            }
            return(listItems);// items.Values;
        }