I know I'm doing something wrong here, I just don't know what as I'm not very sure what the issue is. Here's the code which is called:
The call
System.Linq.Expressions.Expression<Func<AccountDataModel, bool>> deleg =
(m => m.Email == model.Email);
AccountDataModel query = database.FindBy(deleg);
Where the call leads to
public T FindBy(Expression<Func<T, bool>> expression)
{
return FilterBy(expression).Single();
}
public IQueryable<T> FilterBy(Expression<Func<T, bool>> expression)
{
return All().Where(expression).AsQueryable();
}
public IQueryable<T> All()
{
return (from data in _session.Query<T>()
select data);
}
The exception thrown
Sequence contains no elements
Ze details
Basically, what I'm trying to test right now is a registration module on my website which is supposed to search for an email which has been provided to see if it exists. I have an encrypted email address hidden in the database (and, yes, the email in the model has been encrypted as well) which is supposed to match up with the registration email provided. The problem is that no results are being returned.
What exactly am I doing wrong here?