Soloco.RealTimeWeb.Environment.Core.Configuration.ClusterSettings.GetTask C# (CSharp) Method

GetTask() public method

public GetTask ( string name ) : TaskSettings
name string
return TaskSettings
        public TaskSettings GetTask(string name)
        {
            if (Tasks == null)
            {
                throw new InvalidOperationException("Tasks is null");
            }

            var task = Tasks.FirstOrDefault(criteria => criteria.Name == name);
            if (task == null)
            {
                throw new InvalidOperationException("Could not find task: " + name);
            }
            return task;
        }
    }

Usage Example

        public M201602102132_CreateVPC(MigrationContext context)
        {
            if (context == null) throw new ArgumentNullException(nameof(context));

            _context = context;
            _client = CreateClient();
            _cluster = _context.Settings.Cluster;
            _task = _cluster.GetTask("web");
        }
All Usage Examples Of Soloco.RealTimeWeb.Environment.Core.Configuration.ClusterSettings::GetTask
ClusterSettings