예제 #1
0
        public ReferrerSearchQuery GetReferrerSearchQuery(ISession session)
        {
            ReferrerSearchQuery rsq = null;

            if (Id == 0)
            {
                rsq = (ReferrerSearchQuery)session.CreateCriteria(typeof(ReferrerSearchQuery))
                    .Add(Expression.Eq("SearchQuery", SearchQuery))
                    .UniqueResult();

                if (rsq == null)
                {
                    rsq = new ReferrerSearchQuery();
                    rsq.RequestCount = RequestCount;
                }
                else
                {
                    rsq.RequestCount += RequestCount;
                }
            }
            else
            {
                rsq = (ReferrerSearchQuery)session.Load(typeof(ReferrerSearchQuery), Id);
                rsq.RequestCount = RequestCount;
            }

            rsq.SearchQuery = SearchQuery;
            return rsq;
        }
예제 #2
0
 public TransitReferrerSearchQuery(DBlog.Data.ReferrerSearchQuery o)
     : base(o.Id)
 {
     SearchQuery  = o.SearchQuery;
     RequestCount = o.RequestCount;
 }
예제 #3
0
 public ReferrerSearchQueryTest()
 {
     mReferrerSearchQuery = new ReferrerSearchQuery();
     mReferrerSearchQuery.RequestCount = 10;
     mReferrerSearchQuery.SearchQuery = Guid.NewGuid().ToString();
 }