public async Task <bool> Handle(CreateServerRequest message, IOutputPort <CreateNewServerResponse> outputPort)//, IOutputPort<CreateNewServerResponse> outputPort { var response = await _serverRepository.Create(new Server(Guid.NewGuid(), message.CreatedAt, message.CreatedBy, message.DeletedAt, message.DeletedBy, message.EndDate, message.IpAddress, message.IsDeleted, message.Name, message.StartDate, message.Status, message.UpdatedAt, message.UpdatedBy)); //outputPort.Handle(response.Success ? new CreateNewServerResponse(response.Id, true) : new CreateNewServerResponse(response.Errors.Select(e => e.Description))); return(response.Success); }
public Server Create(Server server) { return(_serverRepository.Create(server)); }