public static bool UnAssignUser(int backlogId, int memberId) { using (var db = new ScrumApplicationDbContext()) { if (IsUserAssigned(backlogId, memberId) == 1) { var existBTM = db.BacklogToMembers.FirstOrDefault(x => x.MemberId == memberId && x.ProductBacklogId == backlogId); if (existBTM != null) { db.BacklogToMembers.Remove(existBTM); db.SaveChanges(); var existBacklog = db.ProductBacklogs.FirstOrDefault(x => x.ProductBacklogId == backlogId); ActivityRepository.ActivityCreator ("unassigned " + existBTM.MemberName + " from " + existBacklog.Name, existBacklog.ProjectId, existBacklog.ProductBacklogId); return(true); } } return(false); } }