示例#1
0
        //C create
        public async Task <ProjectParticipationHistory> CreateAsync(ProjectParticipationHistory projectParticipationHistory)
        {
            // projectParticipationHistory.User = await _unitOfWork.UserRepository.
            await _unitOfWork.ProjectParticipationHistory.AddAsync(projectParticipationHistory);

            await _unitOfWork.CommitAsync();

            return(projectParticipationHistory);
        }
示例#2
0
        // U
        public async Task <ProjectParticipationHistory> UpdateAsync(ProjectParticipationHistory projectParticipationHistory)
        {
            var result = await _unitOfWork.ProjectParticipationHistory.UpdateAsync(projectParticipationHistory, projectParticipationHistory.ProjectId);

            if (result == null)
            {
                throw new UserFriendlyException(500, "Internal server Error");
            }

            await _unitOfWork.CommitAsync();

            return(result);
        }
        public async Task <IHttpActionResult> Create(ProjectParticipationHistoryBindingModel projectModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            ProjectParticipationHistory projectHistory = new ProjectParticipationHistory();

            Mapper.Map(projectModel, projectHistory);

            var result = await _projectParticipationHistoryService.CreateAsync(projectHistory);

            return(Ok(result));
        }
示例#4
0
 public void RemoveFromProject(ProjectParticipationHistory participationHistory)
 {
     throw new NotImplementedException();
 }
示例#5
0
 public void AddToProject(ProjectParticipationHistory participationHistory)
 {
     throw new NotImplementedException();
 }
示例#6
0
 public void RemoveFromProject(ProjectParticipationHistory participationHistory)
 {
     _dbSetParticipationHistories.Remove(participationHistory);
 }
示例#7
0
 public void AddToProject(ProjectParticipationHistory participationHistory)
 {
     _dbSetParticipationHistories.Add(participationHistory);
 }
 public virtual void Delete(ProjectParticipationHistory projectRole)
 {
     unitOfWork.ProjectParticipationHistories.Remove(projectRole);
     unitOfWork.Save();
 }
 public virtual void Insert(ProjectParticipationHistory projectRole)
 {
     unitOfWork.ProjectParticipationHistories.Insert(projectRole);
     unitOfWork.Save();
 }