예제 #1
0
        // POST api/<controller>
        public void PostPool(Pool pool)
        {
            try
            {
                string connectionString = Properties.Settings.Default.FreeFootieConnectionString;
                using (FreeFootieDataContext myData = new FreeFootieDataContext(connectionString))
                {
                    using (TransactionScope myScope = new TransactionScope())
                    {
                        pool newPool = new pool();
                        var newID = (from c in myData.pools
                                     select c.id).Max();
                        newPool.id = newID + 1;
                        newPool.name = pool.name;

                        myData.pools.InsertOnSubmit(newPool);
                        myData.SubmitChanges();
                        myScope.Complete();
                    }
                }
            }
            catch (Exception ex)
            {
                Common.ErrorCatch(ex, "PoolController.PostPool");

            }
        }
예제 #2
0
 partial void Updatepool(pool instance);
예제 #3
0
 partial void Deletepool(pool instance);
예제 #4
0
 partial void Insertpool(pool instance);