ActivEarth.DAO.BadgeDAO.GetBadgesFromUserId C# (CSharp) Метод

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

Retrieves the collection of badges belonging to a given user.
public static GetBadgesFromUserId ( int userId ) : List
userId int
Результат List
        public static List<Badge> GetBadgesFromUserId(int userId)
        {
            using (SqlConnection connection = ConnectionManager.GetConnection())
            {
                var data = new ActivEarthDataProvidersDataContext(connection);
                List<Badge> badges = (from c in data.BadgeDataProviders
                               where c.user_id == userId
                               select
                                   new Badge
                                   {
                                       ID = c.id,
                                       UserID = c.user_id,
                                       StatisticBinding = (Statistic)c.statistic,
                                       Level = c.badge_level,
                                       Progress = c.progress
                                   }).ToList();

                foreach (Badge badge in badges)
                {
                    LoadExternalBadgeData(badge);
                }

                return badges;
            }
        }