예제 #1
0
        /// <summary>
        /// Gets current User's Id.
        /// Throws <see cref="BdfException"/> if <see cref="IBdfSession.UserId"/> is null.
        /// </summary>
        /// <param name="session">Session object.</param>
        /// <returns>Current User's Id.</returns>
        public static long GetUserId(this IBdfSession session)
        {
            if (!session.UserId.HasValue)
            {
                throw new BdfException("Session.UserId is null! Probably, user is not logged in.");
            }

            return(session.UserId.Value);
        }
예제 #2
0
 protected UnitOfWorkBase(IUnitOfWorkDefaultOptions defaultOptions)
 {
     Id         = Guid.NewGuid().ToString("N");
     _filters   = defaultOptions.Filters.ToList();
     BdfSession = NullBdfSession.Instance;
 }
예제 #3
0
 protected UnitOfWorkBase(IUnitOfWorkDefaultOptions defaultOptions)
 {
     Id = Guid.NewGuid().ToString("N");
     _filters = defaultOptions.Filters.ToList();
     BdfSession = NullBdfSession.Instance;
 }
예제 #4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 protected ApplicationService()
 {
     BdfSession = NullBdfSession.Instance;
 }