コード例 #1
0
        public async Task <IActionResult> GetAllUsers()
        {
            var users = _sportsShopDBContext.GetUsers().Where(u => u.role == 1).ToList();
            List <Resources.Users> uList = new List <Resources.Users>();

            foreach (var u in users)
            {
                Resources.Users usr = new Resources.Users
                {
                    id       = u.Id,
                    name     = u.Name + " " + u.LName,
                    userName = u.UserName
                };
                uList.Add(usr);
            }
            return(Ok(uList));
        }
コード例 #2
0
        public IEnumerable <UserMDB> GetUsers()
        {
            List <UserMDB> users = _sportsShopDBContext.GetUsers();

            return(users);
        }