Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created September 28, 2017 10:17
Show Gist options
  • Save NMZivkovic/402db16e753413e4deda73dee78e4a13 to your computer and use it in GitHub Desktop.
Save NMZivkovic/402db16e753413e4deda73dee78e4a13 to your computer and use it in GitHub Desktop.
try
{
Console.WriteLine("Enter entity type:");
var entytyType = (EntityType)Enum.Parse(typeof(EntityType), Console.ReadLine(), true);
Console.WriteLine("Enter new value:");
var modificationValue = Convert.ToInt32(Console.ReadLine());
var entityFactory = new EntityFactory();
var entity = entityFactory.GetEntityBasedOnType(entytyType);
var result = entity.GetNewValue(modificationValue);
Console.WriteLine(result);
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment