AJH.CMS.Core.Data.AttributeDataMapper.GetAttribute C# (CSharp) Method

GetAttribute() static private method

static private GetAttribute ( List attributes, System.Data.SqlClient.SqlDataReader reader ) : Attribute
attributes List
reader System.Data.SqlClient.SqlDataReader
return AJH.CMS.Core.Entities.Attribute
        internal static AJH.CMS.Core.Entities.Attribute GetAttribute(List<AJH.CMS.Core.Entities.Attribute> attributes, SqlDataReader reader)
        {
            int colIndex = 0;
            colIndex = reader.GetOrdinal(CN_ATTRIBUTE_ID);
            int value = reader.GetInt32(colIndex);

            AJH.CMS.Core.Entities.Attribute attribute = attributes.Where(c => c.ID == value).FirstOrDefault();
            if (attribute == null)
            {
                attribute = new AJH.CMS.Core.Entities.Attribute();
                attributes.Add(attribute);
            }
            return attribute;
        }

Same methods

AttributeDataMapper::GetAttribute ( int id, int languageID ) : Attribute