Ejemplo n.º 1
0
        public int GetGroupIdByEmailId(int mailId)
        {
            string userID = "";

            if (_httpContextAccessor != null && _httpContextAccessor.HttpContext != null && _httpContextAccessor.HttpContext.User != null &&
                _httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier) != null && !String.IsNullOrEmpty(_httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value))
            {
                userID = _httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
            }
            else
            {
                return(-1);
            }

            var mail = _mailRepository.GetGroupIdByEmailId(mailId, userID);

            return(mail);
        }