Exemplo n.º 1
0
        public async Task <Models.Bulletin> Retrieve(string partition, string key)
        {
            System.Diagnostics.Trace.TraceInformation(string.Format("Call Bulletin::Retrieve({0}, {1})", partition, key));

            // add model to
            TableStorageAsync <Models.Bulletin> table;

            table = new TableStorageAsync <Models.Bulletin>(TableName, ConnStr);
            await table.ConnectAsync();

            CurrentBulletin = await table.GetEntityByPartitionKeyAndRowKeyAsync(partition, key);

            return(CurrentBulletin);
        }
Exemplo n.º 2
0
        public async Task RetrieveAll()
        {
            TableStorageAsync <Models.Bulletin> table = new TableStorageAsync <Models.Bulletin>(TableName, ConnStr);
            await table.ConnectAsync();

            var bulletins = await table.GetAllEntitiesAsync();

            AllBulletins = bulletins?.ToList <Models.Bulletin>();
            AllBulletins.Sort();
            if (AllBulletins.Count == 0)
            {
                CurrentBulletin = new Bulletin();
            }
            else
            {
                CurrentBulletin = AllBulletins[0];
            }
        }