/// <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); }
protected UnitOfWorkBase(IUnitOfWorkDefaultOptions defaultOptions) { Id = Guid.NewGuid().ToString("N"); _filters = defaultOptions.Filters.ToList(); BdfSession = NullBdfSession.Instance; }
/// <summary> /// Constructor. /// </summary> protected ApplicationService() { BdfSession = NullBdfSession.Instance; }