Skip to content

How to use with async #2

@SharpNoiZy

Description

@SharpNoiZy

Hi jkodroff,

I followed your tutorial and everything is awesome!
Except the fact that I don't know how to use it with async and await.
Can you advise how to do that?

var dbResult = await from user in _dataSession.Set<User>()
                           join role in _dataSession.Set<UserRole>() on user.UserRoleId equals role.Id
                           where user.UserName == query.Username && user.PasswordHash == hashedPassword
                           select new { User = user, Role = role };

The only thing I changed of your code is that .Set<> returns IQuerable<> instead of DbSet<> because I want to use the same code later on with EF7.

Kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions