public void Add(T entity) { using (RadioContext context = new RadioContext()) { context.GetTable <T>().InsertOnSubmit(entity); context.SubmitChanges(); } }
public void DeleteAll(Expression <Func <T, bool> > predicate) { using (RadioContext context = new RadioContext()) { var entitys = context.GetTable <T>().Where(predicate).ToList(); if (entitys != null && entitys.Count > 0) { context.GetTable <T>().DeleteAllOnSubmit(entitys); context.SubmitChanges(); } } }