public List<clsTestimonials> GetAll(int id) { try { List<clsTestimonials> obj= new List<clsTestimonials>(); obj = this.obj.GetAll(); foreach (clsTestimonials item in obj) { if (item.Id == id) { obj.Remove(item); break; } } return obj; } catch (Exception) { throw; } }
public clsTestimonials GetByShort() { try { clsTestimonials obj = new clsTestimonials(); obj= this.obj.GetAll()[0]; obj.NoiDung = obj.NoiDung.Substring(0, obj.NoiDung.Length > 300 ? 300 : obj.NoiDung.Length); return obj; } catch (Exception) { throw; } }