Ejemplo n.º 1
0
        /// <summary>
        /// Gets the user id by username.
        /// </summary>
        /// <param name="userName">The username</param>
        /// <returns></returns>
        public async Task <int> GetUserId(string userName)
        {
            var userId = await AppCache <int> .GetOrCreate("userKey" + userName, async() => await _userRepository.GetUserIdAsync(userName));

            return(userId);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the user detail by user id.
        /// </summary>
        /// <param name="userId">The user id</param>
        /// <returns></returns>
        public async Task <UserDetail> GetUserDetailByUserId(int userId)
        {
            var userDetail = await AppCache <UserDetail> .GetOrCreate("userDetail" + userId, async() => await _userRepository.GetUserDetailByUserIdAsync(userId));

            return(userDetail);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the recurrence types
        /// </summary>
        /// <returns></returns>
        public async Task <List <RecurrenceType> > GetRecurrenceTypes()
        {
            var recurrenceTypes = await AppCache <List <RecurrenceType> > .GetOrCreate("recurrenceTypes", async() => await _recurrenceTypeRepository.GetRecurrenceTypesAsync());

            return(recurrenceTypes);
        }