Esempio n. 1
0
        public List <UsersEntity> Get()
        {
            var users = new List <UsersEntity>();

            using (var con = new SqlConnection(connectionString))
            {
                con.Open();
                var cmd = new SqlCommand("SELECT * FROM UserDetails", con);

                using (var dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        users.Add(usersMapper.mapUsers(dr));
                    }
                }
            }

            return(users);
        }