private SectionDTO FindSection(ReportModels.Stall byf) { var secId = (int)byf.Section.Id.Value; var sec = AppArgs.MarketState.Sections.Find(secId, false); if (sec == null) { throw No.Match <SectionDTO>("Id", secId); } return(sec); }
private RightsParams FindDefaultRights(ReportModels.Stall byf) => _byfLeases.FindLatestOccupancy(byf, _lseConv)?.Rights;
private RentParams FindDefaultRent(ReportModels.Stall byf) => _byfLeases.FindLatestOccupancy(byf, _lseConv)?.Rent;
public static LeaseDTO FindLatestOccupancy(this List <ReportModels.Lease> byfLeases, ReportModels.Stall stall, LeaseConverter1 lseConv) { var latest = byfLeases.Where(_ => _.Stall.Id.Value == stall.Id.Value) .OrderBy(_ => _.Id.Value) .LastOrDefault(); if (latest == null) { return(null); } return(lseConv.CastByfToDTO(latest) as LeaseDTO); }