﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Moody.DevelopmentBasics.EntityFramework
{
    public class EntitiyStateSample
    {
        // Every Entity has a certain state through its lifecycle

        // These are defined as 

        public static void Execute()
        {
            Console.WriteLine(System.Data.Entity.EntityState.Added.ToString() );
            Console.WriteLine(System.Data.Entity.EntityState.Deleted.ToString());
            Console.WriteLine(System.Data.Entity.EntityState.Detached.ToString());
            Console.WriteLine(System.Data.Entity.EntityState.Modified.ToString());
            Console.WriteLine(System.Data.Entity.EntityState.Unchanged.ToString());

            // These states allow the Context class to maintain change Tracking and the seletion of the correct sql operation ( update, insert, delete )
        }
    }
}
