public IActionResult Create([FromBody] Todo item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            _todo.Add(item);

            return(Created($"api/todo/{item.Id}", item));
        }
Exemple #2
0
        /// <summary>
        /// Get all data sorted by date - this may not be sufficient to get small enough datasets for big tables
        /// </summary>
        void SortDataByTime()
        {
            Variable timeVariable;

            if (metadata.Variables.Keys.Contains("tid"))
            {
                timeVariable = metadata.Variables["tid"];
            }
            else
            {
                timeVariable = metadata.Variables["time"];
            }

            metadata.variables.Remove(timeVariable);

            // generate a request for each unique time
            foreach (var time in timeVariable.values)
            {
                TableMetadata request = CopyMetadata(metadata);

                var this_time_variable = CopyVariable(timeVariable);
                this_time_variable.values.Add(time);
                request.variables.Add(this_time_variable);

                foreach (var variable in metadata.variables)
                {
                    var _var = CopyVariable(variable);
                    foreach (var _val in variable.values)
                    {
                        _var.values.Add(_val);
                    }

                    request.variables.Add(_var);
                }

                Todo.Add(request);
                AllRequests.Add(request);
            }

            metadata.variables.Add(timeVariable);

            Console.WriteLine($"Number of things to request: {Todo.Count}");

            return;
        }
 internal void Add(Tag tag)
 {
     currentTodo.Add(tag);
 }
Exemple #4
0
 public MainViewModel()
 {
     Todo.Add(new Item("Go fishing"));
     Todo.Add(new Item("Talk about Xamarin"));
 }