/// <summary> /// Simple example for AttachRange, SaveChanges will return 0 /// </summary> /// <param name="items">Customers list</param> /// <returns>true for SaveChanges returns 0</returns> public static bool AttachCustomersRange(List <Customers> items) { using (var context = new NorthwindContext()) { context.AttachRange(items); var unChanged = items .Select(customer => context.Entry(customer).State) .All(entityState => entityState == EntityState.Unchanged); return(context.SaveChanges() == 0 && unChanged); } }