public void Put(long taskId, long categoryId)
        {
            var task = _taskFetcher.GetTask(taskId);

            var category = task.Categories.FirstOrDefault(x => x.CategoryId == categoryId);

            if (category != null)
            {
                return;
            }

            category = _categoryFetcher.GetCategory(categoryId);

            task.Categories.Add(category);

            _session.SaveOrUpdate(task);
        }
Beispiel #2
0
        public Category Get(long id)
        {
            var category = _categoryFetcher.GetCategory(id);

            return(_categoryMapper.CreateCategory(category));
        }