public bool Delete(string loginLogId, out string strResult) { strResult = string.Empty; bool result = false; Guid loid = new Guid(loginLogId); var log = LoginLogRepository.GetQueryable().FirstOrDefault(lo => lo.LogID == loid); if (log != null) { LoginLogRepository.Delete(log); LoginLogRepository.SaveChanges(); result = true; } else { strResult = "原因:未找到当前需要删除的数据!"; } return(result); }
public bool Emptys(out string strResult) { strResult = string.Empty; bool result = false; var log = LoginLogRepository.GetQueryable(); if (log != null) { foreach (var lo in log) { LoginLogRepository.Delete(lo); } LoginLogRepository.SaveChanges(); result = true; } else { strResult = "原因:未找到当前需要删除的数据!"; } return(result); }