Ejemplo n.º 1
0
        public static TestDB <T> CreateInstance(string connStr)
        {
            var conn = new SqlConnection(connStr);
            var inst = new TestDB <T>(conn);

            Database.SetInitializer(new DropCreateDatabaseIfModelChanges <TestDB <T> >());


            return(inst);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var connStr = @"Data Source=hds260381389.my3w.com;Initial Catalog=hds260381389_db;Persist Security Info=True;User ID=hds260381389;Password=75737573";
            var item    = new Test()
            {
                Name = DateTime.Now.ToString(), Name2 = new Random().NextDouble().ToString()
            };

            TestDB <Test> .CreateInstance(connStr).Save(item);
        }