Exemple #1
0
        public static EquipmentViewModel Create(IRepositoryFactory repositoryFactory, Equipment equipment = null, EquipmentReservation equipmentReservation = null)
        {
            var viewModel = new EquipmentViewModel()
            {
                Equipment            = equipment,
                EquipmentReservation = equipmentReservation ?? new EquipmentReservation()
            };

            if (equipment == null)
            {
                viewModel.Equipments = repositoryFactory.EquipmentRepository.Queryable.Where(a => a.Operator.ToLower() == EquipmentOperators.User).OrderBy(a => a.Name).ToList();
            }

            return(viewModel);
        }
        public static EquipmentViewModel Create(IRepositoryFactory repositoryFactory, Equipment equipment = null, EquipmentReservation equipmentReservation = null)
        {
            var viewModel = new EquipmentViewModel()
                {
                    Equipment = equipment,
                    EquipmentReservation = equipmentReservation ?? new EquipmentReservation()
                };

            if (equipment == null)
            {
                viewModel.Equipments = repositoryFactory.EquipmentRepository.Queryable.Where(a => a.Operator.ToLower() == EquipmentOperators.User).OrderBy(a => a.Name).ToList();
            }

            return viewModel;
        }