using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tango.Synchronization
{
///
/// Represents an result.
///
public class Diff
{
private Action _action;
///
/// Gets the action which will be taken in order to commit this difference.
///
public DiffAction Action { get; private set; }
///
/// Gets the difference description.
///
public String Description { get; private set; }
///
/// Gets the SQL command.
///
public String Command { get; private set; }
///
/// Initializes a new instance of the class.
///
/// The difference action type.
/// The action description.
/// The action delegate.
/// The SQL command.
public Diff(DiffAction diffAction, String description, Action action, String command)
{
Action = diffAction;
Description = description;
_action = action;
Command = command;
}
///
/// Commits this difference to the target DB.
///
public void Commit()
{
_action();
}
///
/// Returns a that represents this instance.
///
///
/// A that represents this instance.
///
public override string ToString()
{
return Command;
}
}
}