Example #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);
        }
Example #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];
            }
        }