Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
        public void Create(CreateProjectTaskType createProjectTaskType)
        {
            var project = repository.Get<Project>(createProjectTaskType.ProjectId);
            var task = repository.Get<Task>(createProjectTaskType.TaskId);
            var taskType = repository.Get<TaskType>(createProjectTaskType.TaskTypeId);

            ProjectTaskType projectTaskType = new ProjectTaskType()
                                              	{
                                              		Id = Guid.NewGuid(),
                                              		Name = createProjectTaskType.Name,
                                              		Project = project,
                                              		Task = task,
                                              		Type = taskType
                                              	};

            repository.Insert(projectTaskType);
        }
示例#2
0
        public void SetUp()
        {
            repository = MockRepository.GenerateMock<IRepository>();
            userTasks = MockRepository.GenerateMock<IUserTasks>();
            projectTaskType = new ProjectTaskType();
            user = new User();

            this.createWorkItemRequest = new CreateWorkItemRequest()
            {
                Name = "Bond",
                ProjectTaskTypeId = Guid.NewGuid()
            };
            repository.Stub(x => x.Get<ProjectTaskType>(createWorkItemRequest.ProjectTaskTypeId)).Return(projectTaskType);
            repository.Stub(x => x.Query<WorkItem>()).Return((new WorkItem[0]).AsQueryable());
            userTasks.Stub(x => x.GetCurrentUser()).Return(user);
        }
		private void detach_ProjectTaskTypes(ProjectTaskType entity)
		{
			this.SendPropertyChanging();
			entity.Task = null;
		}
		private void attach_ProjectTaskTypes(ProjectTaskType entity)
		{
			this.SendPropertyChanging();
			entity.Project = this;
		}