public void DeleteById(int id) { var databaseResult = _db.Projects.Where(x => x.Id == id && !x.Deleted).FirstOrDefault(); if (databaseResult != null) { databaseResult.Deleted = true; _db.SaveChanges(); } }
public void AssignUserToProject(int userId, int ProjectId) { _db.ProjectUsers.Add(new ProjectUsers { ProjectId = ProjectId, UserId = userId }); _db.SaveChanges(); }