Exemple #1
0
 ///<summary>Creates tables that should only be loaded at design-time.</summary>
 ///<remarks>At runtime, these tables are loaded when needed.  However, I still want them in the designer.</remarks>
 static void AddDesignTimeTables(DataContext context)
 {
     context.Tables.AddTable(SeatingReservation.CreateTable());
     context.Tables.AddTable(MelaveMalkaInfo.CreateTable());
     context.Tables.AddTable(MelaveMalkaInvitation.CreateTable());
     context.Tables.AddTable(MelaveMalkaSeat.CreateTable());
     context.Tables.AddTable(Caller.CreateTable());
     context.Tables.AddTable(AdReminderEmail.CreateTable());
     context.Tables.AddTable(RaffleTicket.CreateTable());
 }
Exemple #2
0
        protected override DataSyncContext CreateDataContext()
        {
            var dc = new DataContext();

            dc.Tables.AddTable(Person.CreateTable());
            dc.Tables.AddTable(RaffleTicket.CreateTable());

            var dsc = new DataSyncContext(dc, new SqlCeSqlProvider(FilePath));

            dsc.Tables.AddPrimaryMappings();

            if (!File.Exists(FilePath))
            {
                DB.CreateFile(FilePath, DatabaseFile.SqlCe);
                try {
                    DBManager.SetupDatabase(dsc);
                } catch { File.Delete(FilePath); }
            }

            return(dsc);
        }