Пример #1
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 += OnSuspending;

            using (var emoteDatabase = new EmotibleDataContext())
            {
                emoteDatabase.Database.Migrate();
            }
        }
Пример #2
0
 public Emote AddEmote()
 {
     //TODO: Share this reference
     using (var dataContext = new EmotibleDataContext())
     {
         //return await Task.Run(() =>
         //{
         dataContext.Emotes.Add(new Emote()
         {
             EmoteText = "Hello, I'm an Emote", Name = "First Emote"
         });
         dataContext.SaveChanges();
         return(dataContext.Emotes.First());
         //});
     }
 }