コード例 #1
0
 public IUser GetByID(Guid userID)
 {
     IUser userFound = users.SingleOrDefault(user => user.ID == userID);
     if(userFound == null)
     {
         userFound = new NullUser();
     }
     return userFound;
 }
コード例 #2
0
        public IUser GetByID(Guid userID)
        {
            IUser userFound = users.SingleOrDefault(user => user.ID == userID);

            if (userFound == null)
            {
                userFound = new NullUser();
            }
            return(userFound);
        }
 public IUser GetByID(Guid userID)
 {
     //Contract.Ensures(Contract.Result<IUser>() != null);
     IUser userFound = users.SingleOrDefault(k => k.ID == userID);
     if (userFound == null)
     {
         userFound = new NullUser();
     }
     return userFound;
 }