Blog.Logic.Core.UsersLogic.GetByIdentity C# (CSharp) Method

GetByIdentity() public method

public GetByIdentity ( string identityId ) : User
identityId string
return User
        public User GetByIdentity(string identityId)
        {
            try
            {
                var dbUser = _userRepository.Find(a => a.IdentityId == identityId, null, null).FirstOrDefault();
                if (dbUser != null) return UserMapper.ToDto(dbUser);

                return new User().GenerateError<User>((int)Constants.Error.RecordNotFound, "User not found"); 
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
        }