public void DeleteSession(ISessionViewModel session) { using (var connection = DependencyService.Get <ISQLite>().GetConnection()) { connection.Delete <SessionRow>(session.SessionId); if (session.SessionWorkOuts != null) { foreach (var workOut in session.SessionWorkOuts) { if (workOut.WorkOutSets != null) { foreach (var set in workOut.WorkOutSets) { _setRepository.DeleteSet(set); } } _workoutRepository.DeleteWorkOut(workOut); } } } }