예제 #1
0
        public void TestMethod1()
        {
            StoreUserRepository storeRepository = new StoreUserRepository(dbContext);

            foreach (var s in storeRepository.GetAll())
            {
                Console.WriteLine(s.StoreId);
            }
        }
        public override ActionResult Users(int storeId = 0, String search = "")
        {
            var storeUserIds = StoreUserRepository.GetAll().Select(r => r.UserId).ToList();

            var storeUsers = (from u in DbContext.UserProfiles where !storeUserIds.Contains(u.UserId) select u).ToList();

            if (!String.IsNullOrEmpty(search))
            {
                storeUsers =
                    storeUsers.Where(r => r.UserName.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0).ToList();
            }

            ViewBag.Roles = DbContext.Roles.ToList();
            return(View(storeUsers.ToList()));
        }