Esempio n. 1
0
        public void Save(TaskFile taskFile)
        {
            // IEnumerable<object> attachments = new List<object>();
            // attachments.Append(taskFile.Task);
            // attachments.Append(taskFile.User);

            // repository.AttachRange(attachments);
            repository.Attach(taskFile.Task);
            repository.Attach(taskFile.Task.User);

            if (taskFile.TaskFileID == 0)
            {
                repository.TaskFiles.Add(taskFile);
            }

            repository.SaveChanges();
        }
Esempio n. 2
0
        public void Delete(TaskFile taskFile)
        {
            Link existing = repository.Links.Find(taskFile.TaskFileID);

            repository.Remove(existing);
        }