public IActionResult DeleteDetails(string accountId = null) { var claims = Request.GetJwtClaims(); if (!claims.IsValidLogin()) { return(claims.Get401Result()); } if (string.IsNullOrEmpty(accountId)) { return(Ok(new { status = false, message = "account id cannot be null or empty", data = accountId })); } if (claims.IsLecture || claims.Admin) { if (accountId != null) { _mogoRepositoryLecture.DeleteOneAsync(x => x.AccountId.Equals(Guid.Parse(accountId))); } var details = _mogoRepositoryLecture.DeleteOneAsync(x => x.AccountId.Equals(claims.AccountId)); return(Ok(new { status = true, message = "Deleted", data = details })); } return(Ok(new { status = false, message = "Request to be performed by a lecture or admin", data = accountId })); }
public async Task <IActionResult> DeleteStudentUniqueId(string uniqueId) { var claims = Request.GetJwtClaims(); if (!claims.IsValidLogin()) { return(claims.Get401Result()); } if (string.IsNullOrEmpty(uniqueId)) { return(Ok(new { status = true, message = "student Number cannot be null or empty", data = uniqueId })); } if (!claims.IsLecture) { return(Ok(new { status = false, message = "Request to be done by Lecture", data = "" })); } var st = await _mongoRepositoryStudents.FindOneAsync(x => x.UniqueId.Equals(uniqueId)); if (st == null) { return(Ok(new { status = false, message = "Student does not exist", data = st })); } await _mongoRepositoryStudents.DeleteOneAsync(x => x.UniqueId.Equals(uniqueId)); return(Ok(new { status = true, message = "successful request", data = st })); }
public Task <bool> DeleteOneAsync(string todo) { Expression <Func <Todo, bool> > expr = null; // Should not call Expression in here. _todoRepository.DeleteOneAsync(expr); return(Task.FromResult(true)); }
public async Task <Brand> DeleteAsync(string id) { var item = await mongoDb.FindByIdAsync(id); if (item != null) { await mongoDb.DeleteOneAsync(c => c.Id == item.Id); return(item); } return(null); }
public async Task <T> DeleteAsync(string id) { var item = await mongoDb.FindByIdAsync(id); if (item != null) { await cloudinaryService.RemoveImageAsync(item.ImgPulbicId); await mongoDb.DeleteOneAsync(c => c.Id == item.Id); return(item); } return(null); }
public async Task RemoveImage(string imageId) { await _mongoRepository.DeleteOneAsync( gameLevelImage => gameLevelImage.Id == imageId); }
public async Task RemoveUser(AuthenticateUserDTO userRemoved) { await _mongoRepository.DeleteOneAsync( user => user.Email == userRemoved.Email); }
public async Task DeleteOne(KeyContacts contact) { await _repo.DeleteOneAsync(x => x.OrgId == contact.OrgId && x.UserId == contact.UserId); }
public async Task RemovePatient(PatientDTO patientRemoved) { await _mongoRepository.DeleteOneAsync( patient => patient.Id == patientRemoved.Id); }
public async Task RemoveUser(string userId) { await _mongoRepository.DeleteOneAsync( user => user.Id == userId); }
public async Task RemoveAdvisor(string advisorId) { await _mongoRepository.DeleteOneAsync( advisor => advisor.Id == advisorId); }
public async Task DeleteOne(PendingOrganisation org) { await _repo.DeleteOneAsync(pendingOrg => org.Id == pendingOrg.Id); }
public async Task RemovePatient(string patientId) { await _mongoRepository.DeleteOneAsync( patient => patient.Id == patientId); }
public async Task RemoveUser(string userId) { await _userRepository.DeleteOneAsync(m => m.UserId == userId); }
public async Task RemoveAdvisor(AdvisorDTO advisorRemoved) { await _mongoRepository.DeleteOneAsync( advisor => advisor.Id == advisorRemoved.Id); }