using(var session=SessionManager.Open())
            using(var tran=session.OpenTransaction())
            {
                session.Query.All<ForgotKey>().Where(a => a.Inserted <= DateTime.Now.AddDays(-1)).Remove();
                tran.Complete();
            }

Active Session is required for this operation. Use Session.Open(...) to open it.

asked Jul 28 '11 at 05:50

proff's gravatar image

proff
75336

Thanks.

That's not good. Actually, the extension method is declared on IEnumerable<TEntity> which doesn't know about Session, but there should be a better way of obtaining Session rather than calling Session.Demand which is meaningless in ServerProfile.

(Jul 28 '11 at 06:12) Dmitri Maximov Dmitri%20Maximov's gravatar image

One Answer:

The issue is fixed. For more information, see the announcement.

answered Jul 31 '11 at 11:04

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA