public IAsyncEnumerable <(Task, IEnumerable <string>)> GetQueueTasks() { // Nullability mismatch: We filter tuples where the containers are null return(_context.TaskOperations.SearchStates(states: TaskStateHelper.Available) .Select(task => (task, _context.TaskOperations.GetInputContainerQueues(task.Config))) .Where(taskTuple => taskTuple.Item2 != null) !); }
public JsonResult GetData() { string connectionString = ConfigurationManager.ConnectionStrings["myConnString"].ConnectionString; TaskOperations operation = new TaskOperations(); List <string> data = new List <string>(); return(Json(operation.GetTasks(connectionString, 1), JsonRequestBehavior.AllowGet)); }
public void TestMin() { // Arrange string data = string.Empty; TaskOperations tOper = new TaskOperations(); // Act int res = tOper.CheckTaskCorrect(data); // Assert Assert.AreEqual(-1, res, 0.001, "Problems with getting wrong small data"); }
public void TestOKMin() { // Arrange string data = "1"; TaskOperations tOper = new TaskOperations(); // Act int res = tOper.CheckTaskCorrect(data); // Assert Assert.AreEqual(0, res, 0.001, "Problems with getting correct small data"); }
static void Main() { Console.WriteLine(Messages.WelcomeMessage()); Console.WriteLine(); string path = "../../data/todos.xml"; IXmlContext context = new XmlContext(path); ITodoRepository repo = new TodoRepository(context); ITodoService service = new TodoService(repo); var ui = new TaskOperations(service); ui.ReadOrWrite(); }
// PUT api/values/5 public bool Put([FromBody] TaskModel record) { try { using (var task = new TaskOperations()) { return(task.UpdateTask(record)); } } catch (Exception ex) { throw ex; } }
public List <ParentModel> GetTaskDetails(bool isParent) { try { using (var task = new TaskOperations()) { return(task.GetTaskDetails(isParent)); } } catch (Exception ex) { throw ex; } }
public List <TaskModel> GetTaskDetails(int taskId) { try { using (var task = new TaskOperations()) { return(task.GetTaskDetails(taskId)); } } catch (Exception ex) { throw ex; } }
public List <TaskModel> GetTaskDetailsByProjectId([FromUri] int projectId) { try { using (var task = new TaskOperations()) { return(task.GetTaskDetailsByProjectId(projectId)); } } catch (Exception ex) { throw ex; } }
// DELETE api/values/5 public bool Delete(int id) { try { using (var task = new TaskOperations()) { return(task.DeleteTaskById(id)); } } catch (Exception ex) { throw ex; } }
public bool Put(int taskId) { try { using (var task = new TaskOperations()) { return(task.UpdateTask(taskId)); } } catch (Exception ex) { throw ex; } }
public void TestOKMax() { // Arrange string data = string.Empty; for (int i = 0; i < 100; i++) { data += '1'; } TaskOperations tOper = new TaskOperations(); // Act int res = tOper.CheckTaskCorrect(data); // Assert Assert.AreEqual(0, res, 0.001, "Problems with getting correct large data"); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Application = new ApplicationOperations(this); Pool = new PoolOperations(this); Account = new AccountOperations(this); Job = new JobOperations(this); Certificate = new CertificateOperations(this); File = new FileOperations(this); JobSchedule = new JobScheduleOperations(this); Task = new TaskOperations(this); ComputeNode = new ComputeNodeOperations(this); ComputeNodeExtension = new ComputeNodeExtensionOperations(this); BaseUri = "{batchUrl}"; ApiVersion = "2021-06-01.14.0"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
public TestContext(ILogTracer logTracer, IStorage storage, ICreds creds, string storagePrefix) { EntityConverter = new EntityConverter(); ServiceConfiguration = new TestServiceConfiguration(storagePrefix); Storage = storage; Creds = creds; Containers = new Containers(logTracer, Storage, Creds, ServiceConfiguration); Queue = new Queue(Storage, logTracer); RequestHandling = new RequestHandling(logTracer); TaskOperations = new TaskOperations(logTracer, this); NodeOperations = new NodeOperations(logTracer, this); JobOperations = new JobOperations(logTracer, this); NodeTasksOperations = new NodeTasksOperations(logTracer, this); TaskEventOperations = new TaskEventOperations(logTracer, this); NodeMessageOperations = new NodeMessageOperations(logTracer, this); ConfigOperations = new ConfigOperations(logTracer, this); PoolOperations = new PoolOperations(logTracer, this); ScalesetOperations = new ScalesetOperations(logTracer, this); UserCredentials = new UserCredentials(logTracer, ConfigOperations); }
public void SaveTask() { TaskOperations taskOps = new TaskOperations(); taskOps.AddTask(taskModel); }
static void Main(string[] args) { Console.WriteLine("Hello, please enter the path to your to do list: "); string toDoPath = Console.ReadLine(); if (toDoPath == "orsi") { toDoPath = @"C:\Users\Nagy Orsi\Documents\C#\TodoApp\Test.txt"; } List <string> todoList = new List <string>(); try { todoList = FileManipulation.ReadFile(toDoPath).ToList <string>(); } catch (MissingFieldException error) { Console.WriteLine(error); return; } List <Task> taskList = TaskOperations.FromStringToTask(todoList); string firstInput = string.Empty; while (firstInput != "q") { firstInput = Console.ReadLine(); switch (firstInput) { case "l": TaskOperations.ListTasks(taskList); break; case "a": Console.WriteLine("Enter the name of the to do: "); string newTodo = Console.ReadLine(); TaskOperations.AddItem(newTodo, taskList); break; case "r": Console.WriteLine("Enter the number of the task you want to remove: "); TaskOperations.ListTasks(taskList); try { int inputNumber = Convert.ToInt32(Console.ReadLine()); TaskOperations.RemoveItem(inputNumber, taskList); } catch (FormatException error) { Console.WriteLine(error.Message); } break; case "c": Console.WriteLine("Enter the number of the task you want to complete: "); int input = Convert.ToInt32(Console.ReadLine()); TaskOperations.CompleteTask(input, taskList); TaskOperations.ListTasks(taskList); break; case "q": todoList = TaskOperations.FromTaskToString(taskList); FileManipulation.WriteToFile(toDoPath, todoList); break; default: Console.WriteLine("Please enter a valid command."); break; } } }