/// <summary> /// یک آیتم را بوسیله کلید اصلی جستجو میکند /// اگر آیتم موجود نباشد خطا پرتاب میکند /// </summary> /// <param name="shiftId"></param> /// <returns></returns> public ShiftPair GetByShiftPairID(decimal shiftId, decimal shiftpairId) { try { Shift shift = shiftRepository.GetById(shiftId, false); if (shift != null) { if (shift.Pairs.Where(x => x.ID == shiftpairId).Count() == 1) { return(shift.Pairs.Where(x => x.ID == shiftpairId).First()); } } throw new ItemNotExists(" شیفت با این شناسه موجود نمیباشد", ExceptionSrc); } catch (Exception ex) { LogException(ex, "Shift", "GetByShiftPairID"); throw ex; } }
public Shift GetById(string id) { return(repo.GetById(id)); }