AJH.CMS.Core.Data.CatalogImageDataMapper.GetCatalogImageByID C# (CSharp) Method

GetCatalogImageByID() static private method

static private GetCatalogImageByID ( int id ) : CatalogImage
id int
return AJH.CMS.Core.Entities.CatalogImage
        internal static CatalogImage GetCatalogImageByID(int id)
        {
            CatalogImage CatalogImage = null;

            using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
            {
                SqlCommand sqlCommand = new SqlCommand(SN_CATALOG_IMAGE_GET_BY_ID, sqlConnection);
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                SqlParameter sqlParameter = null;
                sqlParameter = new SqlParameter(PN_CATALOG_IMAGE_ID, System.Data.SqlDbType.Int);
                sqlParameter.Direction = System.Data.ParameterDirection.Input;
                sqlParameter.Value = id;
                sqlCommand.Parameters.Add(sqlParameter);

                sqlCommand.Connection.Open();
                using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection))
                {
                    while (sqlDataReader.Read())
                    {
                        CatalogImage = new CatalogImage();
                        FillFromReader(CatalogImage, sqlDataReader);
                    }

                    sqlDataReader.Close();
                    sqlCommand.Connection.Close();
                }
            }
            return CatalogImage;
        }