Skip to content

Instantly share code, notes, and snippets.

@MarcoNicolodi
Last active January 17, 2019 22:16
Show Gist options
  • Save MarcoNicolodi/d30354eecb48d6a899174d30de84c6f0 to your computer and use it in GitHub Desktop.
Save MarcoNicolodi/d30354eecb48d6a899174d30de84c6f0 to your computer and use it in GitHub Desktop.
Chain of responsibility
public class Request
{
public Request(string code, bool approve, TrainingEvaluations evaluations, TrainningEffectiveness effectiveness)
{
CriteriaHasEvaluation = evaluations.Find(x => x.EmployeeCode == code.Split('_')[0] && x.CriteriaCode == code.Split('_')[1]).Any();
IsNew = code.Split('_')[1] == IEntity.NewCode;
Effectiveness = effectiveness.Find(x => x.EmployeeCode == code.Split('_')[0]);
HasEffectiveness = effectiveness.Any();
Approve = approve;
}
public bool CriteriaHasEvaluation { get; }
public bool IsNew { get; }
public TrainingEffectiveness TrainingEffectiveness { get; }
public bool HasEffectiveness { get; }
public bool Approve { get; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment