示例#1
0
        // instantiates object to map to data model
        public List <User> GetUsers()
        {
            List <User> users = new List <User>();

            var usersrows = user_repo.GetUsers().Tables[0].Rows;

            for (int i = 0; i < usersrows.Count; i++)
            {
                int    id       = usersrows[i][0].ToInt(-1);
                string username = usersrows[i][1].ToString();
                int    clientid = usersrows[i][2].ToInt(-1);

                users.Add(new User {
                    Id = id, Name = username, ClientId = clientid
                });
            }
            return(users);
        }