本文整理汇总了C#中IUnitOfWork.RemoveObject方法的典型用法代码示例。如果您正苦于以下问题:C# IUnitOfWork.RemoveObject方法的具体用法?C# IUnitOfWork.RemoveObject怎么用?C# IUnitOfWork.RemoveObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUnitOfWork
的用法示例。
在下文中一共展示了IUnitOfWork.RemoveObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteTAMLog
private void DeleteTAMLog(IUnitOfWork unitOfWork, DateTime dateFrom, DateTime dateTo,
List<Can_TamScanLogCMS> listTAMScanLog, Guid userID)
{
//Honda dùng 2 db chấm công nên chỉ xóa dữ liệu trùng
Boolean checkDeleteIdentical = true;
List<Can_TamScanLogCMS> lstDelScan = new List<Can_TamScanLogCMS>();
String status = TAMScanStatus.E_LOADED.ToString();
List<Can_TamScanLogCMS> lstScanDB = unitOfWork.CreateQueryable<Can_TamScanLogCMS>(Guid.Empty,
log => log.TimeLog >= dateFrom && log.TimeLog <= dateTo && log.Status == status).ToList();
if (checkDeleteIdentical)
{
lstDelScan = lstScanDB.Where(del => listTAMScanLog.Any(tam => del.TimeLog == tam.TimeLog
&& ((!string.IsNullOrWhiteSpace(tam.CardCode) && del.CardCode == tam.CardCode)
|| (!string.IsNullOrWhiteSpace(tam.CodeEmp) && del.CodeEmp == tam.CodeEmp)))).ToList();
}
else
{
var lstCardCode = listTAMScanLog.Where(d => !string.IsNullOrWhiteSpace(d.CardCode)).Select(d => d.CardCode).Distinct().ToList();
var lstCodeEmp = listTAMScanLog.Where(d => !string.IsNullOrWhiteSpace(d.CodeEmp)).Select(d => d.CodeEmp).Distinct().ToList();
lstDelScan = lstScanDB.Where(del => lstCardCode.Contains(del.CardCode) || lstCodeEmp.Contains(del.CodeEmp)).ToList();
}
unitOfWork.RemoveObject(lstDelScan.ToArray());
}