public IList <CustomerCardModel> GetUserCards(IdentityQuery <Guid> userId) { EnsureIsValid(userId); try { var userCards = _deps.UserCards.Project <CustomerCardModel>(userId.ToDbQuery <UserCard>()); return(userCards); } catch (Exception ex) { throw new ServiceException("Cannot get user cards.", ex); } }
public void Can_Do_IdentityQuery_WithIdSelector() { var query = new IdentityQuery <string>("Ford"); var dbQuery = query.ToDbQuery <Car, string>(x => x.Make); var cars = Cars.AsQueryable().Query(dbQuery); Assert.IsNotNull(cars); var expected = Cars.Where(x => x.Make == "Ford"); var actual = cars; Assert.IsTrue(expected.SequenceEqual(actual)); }
public void Can_Do_IdentityQuery_WithIdSelector() { var query = new IdentityQuery<string>("Ford"); var dbQuery = query.ToDbQuery<Car, string>(x => x.Make); var cars = Cars.AsQueryable().Query(dbQuery); Assert.IsNotNull(cars); var expected = Cars.Where(x => x.Make == "Ford"); var actual = cars; Assert.IsTrue(expected.SequenceEqual(actual)); }
public IList<CustomerCardModel> GetUserCards(IdentityQuery<Guid> userId) { EnsureIsValid(userId); try { var userCards = _deps.UserCards.Project<CustomerCardModel>(userId.ToDbQuery<UserCard>()); return userCards; } catch (Exception ex) { throw new ServiceException("Cannot get user cards.", ex); } }