public UserAuthentications GetOE_UserAuthenticationsById(long Id)
        {
            var queryAll = _oeUserAuthenticationsRepo.GetAll();

            var query = (from u in queryAll
                         where u.Id == Id
                         select u).FirstOrDefault();

            return(query);
        }
Example #2
0
        public bool IsAuthorized(long instituteId, long userId, long actorId)
        {
            var flagReturn = false;

            try
            {
                var userAuthtic       = _userAuthenticationsRepo.GetAll().ToList();
                var checkIsAuthorized = (dynamic)null;
                checkIsAuthorized = (from ua in userAuthtic
                                     where ua.UserId == userId && ua.ActorId == actorId
                                     select ua.IsActive).SingleOrDefault();
                flagReturn = checkIsAuthorized;
            }
            catch (Exception)
            {
                flagReturn = false;
            }
            return(flagReturn);
        }