public IEnumerable <ListedUser> List(ListRequest request) { using (HellolingoEntities db = new HellolingoEntities()) { int?tag = null; if (request.IsSharedTalkMember) { tag = UserTags.FormerSharedTalkMember; } if (request.IsLivemochaMember) { tag = UserTags.LivemochaMember; } if (request.IsSharedLingoMember) { tag = UserTags.SharedLingoMember; } IEnumerable <ListedUser> listedMembers = db.ListedUsers_GetBy( count: null, belowId: request.BelowId, knows: request.KnownId, learns: request.LearnId, firstName: request.FirstName, lastName: request.LastName, country: null, location: null, minAge: null, maxAge: null, tag: tag ).ToList(); return(listedMembers); } }
public void TestFind() { var db = new HellolingoEntities(); var result = db.ListedUsers_GetBy( //Andriy: I made count 100, because test throws exception. I don't know, whether this exception by intention or not. //Bernard: ^ Fixed: Entity Framework doesn't support default values for stored procedure parameters, so enforced it with a check in the stored procedure. count: null, belowId: null, knows: null, learns: null, firstName: null, lastName: null, country: null, location: null, minAge: null, maxAge: null, tag: null ); var list = result.ToList(); Assert.AreNotEqual(0, list.Count); }