示例#1
0
        // GET api/<controller>
        public IEnumerable <Task> Get()
        {
            TaskRepositorySqlServer trep = new TaskRepositorySqlServer();
            var tasks = trep.Tasks();


            return(tasks);
        }
示例#2
0
        /// <summary>
        /// Persist the new task in the repository
        /// </summary>
        public void Save()
        {
            // create new object and send to server
            TaskDTO td = new TaskDTO();

            td.Name        = this.Name;
            td.Description = this.Description;
            td.Status      = this.Status;

            ITaskRepository taskRepository = new TaskRepositorySqlServer();

            taskRepository.Add(td);
        }