public Boolean AddScope( DHCPv4ScopeCreateInstruction instructions) { CheckScopeCreationInstruction(instructions); base.Apply(new DHCPv4ScopeAddedEvent(instructions)); return(true); }
internal static DHCPv4Scope FromInstructions( DHCPv4ScopeCreateInstruction instructions, Action <DomainEvent> rootApplier, Action <NotifcationTrigger> rootNotifier, ILogger <DHCPv4Scope> logger ) { DHCPv4Scope scope = new DHCPv4Scope(instructions.Id, rootApplier, rootNotifier) { Name = new ScopeName(instructions.Name), Description = new ScopeDescription(instructions.Description), Properties = instructions.ScopeProperties, AddressRelatedProperties = instructions.AddressProperties, }; scope._logger = logger; return(scope); }
public async Task <Guid?> Handle(CreateDHCPv4ScopeCommand request, CancellationToken cancellationToken) { _logger.LogDebug("Handle started"); Guid id = Guid.NewGuid(); DHCPv4ScopeCreateInstruction instruction = new DHCPv4ScopeCreateInstruction { Id = id, Name = request.Name, Description = request.Description, ParentId = request.ParentId, AddressProperties = GetScopeAddressProperties(request), ResolverInformation = GetResolverInformation(request), ScopeProperties = GetScopeProperties(request), }; _rootScope.AddScope(instruction); await _store.Save(_rootScope); return(id); }
public DHCPv4ScopeAddedEvent(DHCPv4ScopeCreateInstruction instructions) { Instructions = instructions; }