private void Apply(NodeContainerVerticalAlignmentReversed @event) { if (_container == null) { throw new ApplicationException($"Invalid internal state. Node container property cannot be null. Seems that node container has never been created. Please check command handler logic."); } _container = NodeContainerProjectionFunctions.Apply(_container, @event); }
public static NodeContainer Apply(NodeContainer existingSpanEquipment, NodeContainerVerticalAlignmentReversed alignmentReversed) { var newAllignment = existingSpanEquipment.VertialContentAlignmemt == NodeContainerVerticalContentAlignmentEnum.Bottom ? NodeContainerVerticalContentAlignmentEnum.Top : NodeContainerVerticalContentAlignmentEnum.Bottom; return(existingSpanEquipment with { VertialContentAlignmemt = newAllignment }); }
public Result ReverseVerticalContentAlignment(CommandContext cmdContext) { if (_container == null) { throw new ApplicationException($"Invalid internal state. Node container property cannot be null. Seems that node container has never been created. Please check command handler logic."); } var reverseEvent = new NodeContainerVerticalAlignmentReversed(this.Id) { CorrelationId = cmdContext.CorrelationId, IncitingCmdId = cmdContext.CmdId, UserName = cmdContext.UserContext?.UserName, WorkTaskId = cmdContext.UserContext?.WorkTaskId }; RaiseEvent(reverseEvent); return(Result.Ok()); }