ActivEarth.DAO.UserStatisticDAO.GetAllStatisticsByUserId C# (CSharp) Метод

GetAllStatisticsByUserId() публичный статический Метод

Retrieves all of a User's Statistics from the DB.
public static GetAllStatisticsByUserId ( int userId ) : List
userId int ID of user to fetch statistic info for.
Результат List
        public static List<UserStatistic> GetAllStatisticsByUserId(int userId)
        {
            var returnDict = new Dictionary<Statistic, float>();
            using (SqlConnection connection = ConnectionManager.GetConnection())
            {
                var data = new ActivEarthDataProvidersDataContext(connection);

                return (from p in data.UserStatisticDataProviders
                        where p.user_id == userId
                        select new UserStatistic((Statistic)p.statistic_type, (float)p.value)
                        {
                            UserStatisticID = p.id,
                            UserID = p.user_id
                        }).ToList();
            }
        }