public bool Sil(int id) { SqlCommand komut = new SqlCommand(string.Format("{0}_sil", typeof(T).Name), Araclar.Baglanti); komut.CommandType = CommandType.StoredProcedure; komut.Parameters.AddWithValue("@id", id); return Araclar.Calıstır(komut); }
public bool Guncelle(T entity,int id) { SqlCommand komut = new SqlCommand(string.Format("{0}_Guncelle", typeof(T).Name), Araclar.Baglanti); komut.CommandType = CommandType.StoredProcedure; foreach (PropertyInfo p in Proplar) { string adi = p.Name; Object deger = p.GetValue(entity); komut.Parameters.AddWithValue("@" + adi, deger); } return Araclar.Calıstır(komut); }