public void Post([FromBody] Mensagem mensagem)
        {
            var list = PersistentList.Create <Mensagem>();

            list.Add(mensagem);
            list.Save();
        }
예제 #2
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += this.OnSuspending;

            var t    = new Tweet();
            var list = PersistentList.Create <Tweet>();

            list.Add(t);
            Debug.WriteLine("Size: " + list.Count);
        }
예제 #3
0
        static void Main(string[] args)
        {
            var t    = new Tweet();
            var list = PersistentList.Create <Tweet>(new BackgroundSave(TimeSpan.FromSeconds(5)));

            list.Saved += (sender, eventArgs) => {
                Console.WriteLine("Saved! Size: " + list.Count);
            };
            for (int i = 0; i < 1000; i++)
            {
                list.Add(t);
            }
            Console.WriteLine("Size: " + list.Count);
            Console.ReadLine();
            list.Clear();
            Console.ReadLine();
            //list.Save();
        }
 public IEnumerable <Mensagem> Get()
 {
     return(PersistentList.Create <Mensagem>());
 }