public List <CeremonyOperationViewModel> GetCeremonyWithOperationsLog() { var result = new List <CeremonyOperationViewModel>(); var ceremonies = _hContext.Ceremonies.ToList(); foreach (var cer in ceremonies) { foreach (var op in cer.CeremonyOperations) { var ops = new CeremonyOperationViewModel { Id = op.Id, CeremonyId = op.CeremonyId, Ceremony = op.Ceremony.Title, Description = op.Description, Operation = op.Operation, OperationDate = op.OperationDate.ToFarsi(), OperatorId = op.OperatorId }; result.Add(ops); } } return(result.OrderByDescending(x => x.Id).ToList()); }
protected static List <CeremonyOperationViewModel> GetCeremonyOperationsLog(List <CeremonyOperation> ceremonyOperations) { var result = new List <CeremonyOperationViewModel>(); foreach (var ceremonyOperation in ceremonyOperations) { var Item = new CeremonyOperationViewModel { Id = ceremonyOperation.Id, CeremonyId = ceremonyOperation.CeremonyId, Ceremony = ceremonyOperation.Ceremony.Title, Description = ceremonyOperation.Description, Operation = ceremonyOperation.Operation, OperationDate = ceremonyOperation.OperationDate.ToFarsi(), OperatorId = ceremonyOperation.OperatorId }; result.Add(Item); } return(result); }