コード例 #1
0
        private static void UpdateDisconectedEntity()
        {
            var samurai = _context.Samurais.Include(s => s.Quotes).Single(s => s.Id == 14);

            var quote = samurai.Quotes.First();

            quote.Text += " New One";

            using (var dbNew = new SamuraiDbContext())
            {
                dbNew.Entry(quote).State = EntityState.Deleted;
                dbNew.SaveChanges();
            }
        }
コード例 #2
0
 public Quotes Update(Quotes quotes)
 {
     context.Entry(quotes).State = EntityState.Modified;
     return(quotes);
 }
コード例 #3
0
 public SecretIdentity Update(SecretIdentity secretIdentity)
 {
     context.Entry(secretIdentity).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     return(secretIdentity);
 }
コード例 #4
0
 public Samurai Update(Samurai samurai)
 {
     _context.Entry(samurai).State = EntityState.Modified;
     return(samurai);
 }
コード例 #5
0
 public Battle Update(Battle Battle)
 {
     context.Entry(Battle).State = EntityState.Modified;
     return(Battle);
 }