Created
December 2, 2018 20:37
-
-
Save carloscds/865d10eca6a9e7090cd9c6ed7a4c7f62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace EFAsNoTracking | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var db = new Contexto(); | |
var dados1 = new Dados(db); | |
var cat = dados1.Get(1); | |
Console.WriteLine(cat.CategoryName); | |
var dados2 = new Dados(db); | |
var cat2 = dados2.Get(2); | |
cat2.CategoryName += " 2"; | |
var tracker = db.ChangeTracker.Entries(); | |
foreach(var t in tracker) | |
{ | |
Console.WriteLine($"{t.Entity.ToString()}, {t.State}"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment