public RobotRepository() { _cache = new ConcurrentDictionary <string, RobotAgreggate>(); RobotAgreggate robot = new ConcreteRobotFactory().MakeARobot(); robot.RobotId = "099153c2625149bc8ecb3e85e03f0022"; robot.RobotName = "EuRobo"; _cache.GetOrAdd(robot.RobotId, robot); }
public Task <Result <Exception, RobotAgreggate> > Handle(RobotCreateCommand command, CancellationToken cancellationToken) { AbstractRobotFactory creator = new ConcreteRobotFactory(); var robot = creator.MakeARobot(); robot.RobotName = command.RobotName; return(Task.FromResult(_repository.Add(robot))); }