예제 #1
0
        public bool CreateIfNotExists(out Exception ex)
        {
            try
            {
                Task <bool> t = Task <bool> .Factory.StartNew(() =>
                {
                    using (var db = new Data.AutomobileDbContext())
                    {
                        db.Database.CreateIfNotExists();
                    }
                    return(true);
                });

                ex = null;
                return(t.Result);
            }
            catch (Exception e)
            {
                ex = e;
                return(false);
            }
        }
예제 #2
0
 public AutomobileController(Data.AutomobileDbContext context) : base(context)
 {
 }
예제 #3
0
 protected Controller(Data.AutomobileDbContext context)
 {
     this.context = context;
 }