Пример #1
0
 public IList <T> GetAll()
 {
     using (var session = SessionFactory.Get())
     {
         return((from account in session.Query <T>()
                 select account).ToList());
     }
 }
        public static void Reset()
        {
            var x =
                new TimeWarpSessionFactory <TimeWarpUserStateClassMap>();

            var query = GetQueryString();

            using (var session = x.Get())
            {
                ISQLQuery sqlquery = session.CreateSQLQuery(query);
                sqlquery.ExecuteUpdate();
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            TimeWarpSessionFactory <TimeWarpUserStateClassMap> x = new TimeWarpSessionFactory <TimeWarpUserStateClassMap>();

            var    now = DateTime.UtcNow;
            var    sqlFormattedDate = now.ToString("yyyy-MM-dd HH:mm:ss");
            string query            =
                string.Format("update UserState Set UserState.PeriodStartTime = '{0}' From	Account	Join UserState on Account.Id = UserState.Account_Id Where Account.IsFake = 1", sqlFormattedDate);

            using (var session = x.Get())
            {
                ISQLQuery sqlquery = session.CreateSQLQuery(query);
                sqlquery.ExecuteUpdate();
            }
        }