public static MetaTag MetaTag(int id) { MetaTag metaTag = new MetaTag(); try { SqlParameter parametre = new SqlParameter("@id", id); using (SqlDataReader dr = SqlHelper.ExecuteReader("icerik_MeteTag", parametre)) { while (dr.Read()) { metaTag = new MetaTag { Title = dr.GetString(dr.GetOrdinal("title")), Description = dr.GetString(dr.GetOrdinal("description")), Keywords = dr.GetString(dr.GetOrdinal("keywords")) }; } } return metaTag; } catch (Exception) { throw; } }
public static MetaTag MetaTag(string serial) { try { MetaTag metaTag = new MetaTag(); SqlParameter parametre = new SqlParameter("@serial", serial); using (SqlDataReader dr = SqlHelper.ExecuteReader("kategori_MetaGetir", parametre)) { while (dr.Read()) { metaTag.Title = dr.GetString(dr.GetOrdinal("title")); metaTag.Description = dr.GetString(dr.GetOrdinal("description")); metaTag.Keywords = dr.GetString(dr.GetOrdinal("keywords")); } } return metaTag; } catch (Exception) { throw; } }