AJH.CMS.Core.Data.CategoryDataMapper.GetCategory C# (CSharp) Method

GetCategory() static private method

static private GetCategory ( List categorys, System.Data.SqlClient.SqlDataReader reader ) : Category
categorys List
reader System.Data.SqlClient.SqlDataReader
return AJH.CMS.Core.Entities.Category
        internal static Category GetCategory(List<Category> categorys, SqlDataReader reader)
        {
            int colIndex = 0;
            colIndex = reader.GetOrdinal(CN_CATEGORY_ID);
            int value = reader.GetInt32(colIndex);

            Category category = categorys.Where(c => c.ID == value).FirstOrDefault();
            if (category == null)
            {
                category = new Category();
                categorys.Add(category);
            }
            return category;
        }