public T Add(T Item) { _db.Entry(Item).State = EntityState.Added; //_db.Recipients.Add(Item); _db.SaveChanges(); return(Item); }
public Recipient Add(Recipient item) { _db.Entry(item).State = EntityState.Added; //_db.Recipients.Add(item); _db.SaveChanges(); return(item); }
public int Add(T item) { //Set.Add(item); _db.Entry(item).State = EntityState.Added; _db.SaveChanges(); return(item.Id); }
protected override void OnStartup(StartupEventArgs e) { IsInDebugModel = false; base.OnStartup(e); using (var db = new MailSenderDB()) { db.Database.Log = log_str => Debug.WriteLine($"EF({DateTime.Now:hh:mm:ss.ttt}): {log_str}"); var servers_ru = db.Servers.Where(server => server.Address.EndsWith(".ru")); foreach (var server in servers_ru) { Debug.WriteLine(server.Name); server.Port = 433; server.UserName += "123"; } db.SaveChanges(); } }
public void SaveChanges() => _db.SaveChanges();
public bool Commit() => _DB.SaveChanges() > 0;
public Sender Add(Sender Item) { _db.Entry(Item).State = EntityState.Added; _db.SaveChanges(); return(Item); }
public Message Add(Message Item) { _db.Entry(Item).State = EntityState.Added; _db.SaveChanges(); return(Item); }
public Recipient Add(Recipient Item) { _db.Entry(Item).State = EntityState.Added; _db.SaveChanges(); return(Item); }
public SchedulerTask Add(SchedulerTask Item) { _db.Entry(Item).State = EntityState.Added; _db.SaveChanges(); return(Item); }
public T Add(T Item) { _db.Entry(Item).State = EntityState.Added; _db.SaveChanges(); return(Item); }