public ModelService( IModelRepository modelRepository, ILogWrapper logger) { ModelRepository = modelRepository; Logger = logger; }
public ModelController(IModelRepository modelRepository, IBrandRepository brandRepository, IMapper mapper) : base( modelRepository, mapper) { _modelRepository = modelRepository; _brandRepository = brandRepository; _mapper = mapper; }
public void PreTestInitialize() { mockedModels = new List <Model> () { new Model() { FieldA = 1, FieldB = "Mock 1" }, new Model() { FieldA = 2, FieldB = "Mock 2" }, new Model() { FieldA = 3, FieldB = "Mock 3" }, new Model() { FieldA = 4, FieldB = "Mock 4" } }; IModelRepository mock = MockRepository.GenerateStub <IModelRepository> (); mock.Stub(m => m.GetModels()).Return(mockedModels); mock.Stub(m => m.IsMock).Return(true); // mock.Stub( m => m.Add()).SetPropertyWithArgument( ninjectKernel.Bind <IModelRepository> ().ToConstant(mock); }
public void Apply(IModelRepository repository) { var parent = repository.Resolve(AbsoluteUri); var newValue = GetNewValue(repository); parent?.GetType().GetProperty(PropertyName)?.SetValue(parent, newValue, null); }
public TruckService(ITruckRepository truckRepository, IDriverRepository driverRepository, IDepartmentRepository departmentRepository, IPartnerRepository partnerRepository, IModelRepository modelRepository, ILicenseValidation licenseValidation, IMaintenanceItemDetailRepository maintenanceItemDetailRepository, IMaintenanceDetailRepository maintenanceDetailRepository, IMaintenanceItemRepository maintenanceItemRepository, IMaintenancePlanDetailRepository maintenancePlanDetailRepository, IUnitOfWork unitOfWork, IInspectionPlanDetailService inspectionPlanDetailService) { this._truckRepository = truckRepository; this._driverRepository = driverRepository; this._departmentRepository = departmentRepository; this._partnerRepository = partnerRepository; this._modelRepository = modelRepository; this._licenseValidation = licenseValidation; this._maintenanceItemDetailRepository = maintenanceItemDetailRepository; this._maintenanceDetailRepository = maintenanceDetailRepository; this._maintenanceItemRepository = maintenanceItemRepository; this._maintenancePlanDetailRepository = maintenancePlanDetailRepository; this._unitOfWork = unitOfWork; this._inspectionPlanDetailService = inspectionPlanDetailService; }
public SaleInfoController() { managerRepository = new ManagerRepository(); clientRepository = new CilentRepository(); productRepository = new ProductRepository(); saleInfoRepository = new SaleInfoRepository(); }
public ModelService(IModelRepository <ModelEntity> modelRepository, Messages messages) : base(modelRepository) { this.modelRepository = modelRepository; this.messages = messages; }
public VehiclesController(IUnitOfWork unitOfWork, IModelRepository modelRepository, IVehicleRepository vehicelRepository, IMapper mapper) { this.unitOfWork = unitOfWork; this.vehicelRepository = vehicelRepository; this.modelRepository = modelRepository; this.mapper = mapper; }
public FlightService(IFlightRepository repository, IModelRepository modelRepository, IAppLogger <FlightService> logger, IMapper mapper) { _flightRepository = repository; _modelRepository = modelRepository; _logger = logger; _mapper = mapper; }
private static List <string> CollectModPaths(IModelRepository modelRepository, out List <string> missingDlcs) { var result = new List <string>(); missingDlcs = new List <string>(); // need mods and cdlcs foreach (var cdlc in modelRepository.GetServerInfo().Cdlcs) { if (ArmaData.IsCDlcInstalled(cdlc)) { result.Add(ArmaData.CDlcMap[cdlc]); } else { missingDlcs.Add(ArmaData.CDlcMap[cdlc]); } } foreach (var mod in modelRepository.GetMods()) { if (mod.GetCurrentSelection() is ModSelectionStorageMod storageMod) { result.Add(storageMod.StorageMod.GetAbsolutePath()); } } return(result); }
public NlpRepository(ILogger <NlpRepository <T> > logger, IMemoryCache cache, IModelRepository <T> modelrepo, ITextMiningRepository <T> txtrepo) { _logger = logger ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(logger)); _cache = cache ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(cache)); _modelrepo = modelrepo ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(modelrepo)); _txtrepo = txtrepo ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(txtrepo)); }
public ExperimentViewModel(IModelRepository repo) { Repo = repo; Progress = 0; Step = 1; }
public DatabaseHandler() { _managerRepository = new ManagerRepository(); _clientRepository = new CilentRepository(); _productRepository = new ProductRepository(); _saleInfoRepository = new SaleInfoRepository(); }
public TruckService(ITruckRepository truckRepo, IMapper mapper, ILogger <TruckService> logger, IModelRepository modelRepo) { _mapper = mapper; _truckRepo = truckRepo; _logger = logger; _modelRepo = modelRepo; }
public DeletePlaylistCommand( IPlaylistHolder playlistHolder, IModelRepository <Playlist> playlistRepository) { _playlistHolder = playlistHolder; _playlistRepository = playlistRepository; }
public SampleController(INlpRepository <Model> repo, IModelRepository <Model> modelrepo, ISummarizer summarizer, IStemmer stemmer) { _repo = repo ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(repo)); _modelrepo = modelrepo ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(modelrepo)); _summarizer = summarizer ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(summarizer)); _stemmer = stemmer ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(stemmer)); }
/// <summary> /// Creates a new model repository with a given parent /// </summary> /// <param name="parent">The parent repository</param> /// <remarks>If no parent repository is provided, the meta repository is used as parent repository</remarks> public ModelRepository(IModelRepository parent) { Locators = new List<IModelLocator>(); Locators.Add(FileLocator.Instance); Parent = parent ?? MetaRepository.Instance; Serializer = MetaRepository.Instance.Serializer; }
public Model Deserialize(Stream source, Uri modelUri, IModelRepository repository, bool addToRepository) { var reader = XmlReader.Create(source); var root = CreateRoot(reader); var model = CreateModelForRoot(root); model.ModelUri = modelUri; if (addToRepository) { repository.Models.Add(modelUri, model); } var context = new ModelSerializationContext(repository, model); Initialize(reader, root, context); foreach (var pair in context.IDs) { var modelElement = pair.Value as ModelElement; if (modelElement != null) { model.RegisterId(pair.Key, modelElement); } } context.Cleanup(); return(model); }
public DbHandler() { ManagerRepository = new ManagerRepository(); ClientRepository = new CilentRepository(); ProductRepository = new ProductRepository(); SaleInfoRepository = new SaleInfoRepository(); }
public Model Deserialize(Stream source, Uri modelUri, IModelRepository repository, bool addToRepository) { var reader = XmlReader.Create(source); var root = CreateRoot(reader); var model = CreateModelForRoot(root); model.ModelUri = modelUri; if (addToRepository) repository.Models.Add(modelUri, model); var context = new ModelSerializationContext(repository, model); Initialize(reader, root, context); foreach (var pair in context.IDs) { var modelElement = pair.Value as ModelElement; if (modelElement != null) { model.RegisterId(pair.Key, modelElement); } } context.Cleanup(); return model; }
/// <summary> /// Applies all changes in this collection to the given repository. /// </summary> /// <param name="repository"></param> public void Apply(IModelRepository repository) { foreach (var change in Changes) { change.Apply(repository); } }
public DeviceService(IDeviceRepository deviceRepo, DeviceServiceHelper deviceServiceHelper, IModelRepository modelRepo) { _deviceRepo = deviceRepo; _deviceServiceHelper = deviceServiceHelper; _modelRepo = modelRepo; }
public FormManager1() { managerRepository = new ManagerRepository(); clientRepository = new CilentRepository(); productRepository = new ProductRepository(); saleInfoRepository = new SaleInfoRepository(); InitializeComponent(); }
public BearerLayerHandlers(IBroadcastService broadcastService, IModelRepository <Model> modelRepository, IElementRepository elementRepository, IEventAggregator eventAggregator) { _broadcastService = broadcastService; _modelRepository = modelRepository; _elementRepository = elementRepository; _eventAggregator = eventAggregator; }
/// <summary> /// Creates a new model repository with a given parent /// </summary> /// <param name="parent">The parent repository</param> /// <param name="serializer">A serializer object or null to use the default</param> /// <param name="locators">A set of model locators</param> /// <remarks>If no parent repository is provided, the meta repository is used as parent repository</remarks> public ModelRepository(IModelRepository parent, IModelSerializer serializer, params IModelLocator[] locators) { models = new ModelRepositoryModelCollection(this); Locators = new List <IModelLocator>(locators); Parent = parent ?? MetaRepository.Instance; Serializer = serializer ?? MetaRepository.Instance.Serializer; Parent.BubbledChange += Parent_BubbledChange; }
public VehiclesController(IVehicleRepository vehicleRepository, IUserRepository userRepository, IModelRepository modelRepository, IUnitOfWork unitOfWork, IUserAccessor userAccessor) { _vehicleRepository = vehicleRepository; _userRepository = userRepository; _modelRepository = modelRepository; _unitOfWork = unitOfWork; _userAccessor = userAccessor; }
//private static IModelRepository movieRepository; //private static IModelRepository directorRepository; public static IModelRepository GetAttractionRepository() { if (attractionRepository == null) { attractionRepository = new AttractionRepository(); } return(attractionRepository); }
public ModelsController(IMapper mapper, IModelRepository modelRepository, IUnitOfWork unitOfWork) { this.mapper = mapper; this.unitOfWork = unitOfWork; this.modelRepository = modelRepository; }
protected override T GetNewValue(IModelRepository repository) { if (ReferenceUri == null) { return(null); } return((T)repository.Resolve(ReferenceUri)); }
/// <summary> /// Ctor /// </summary> /// <param name="deploymentRepository"></param> /// <param name="modelRepository"></param> /// <param name="experimentRepository"></param> public DeploymentCatalog(IDeploymentRepository deploymentRepository, IModelRepository modelRepository, IExperimentRepository experimentRepository) { this.deploymentRepository = deploymentRepository; this.modelRepository = modelRepository; this.experimentRepository = experimentRepository; }
public IHttpActionResult ModelLookup(int makeID) { IModelRepository repo = ModelRepositoryFactory.GetRepository(); var result = repo.GetLookupByMake(makeID); return(Ok(result)); }
public static IModelRepository GetLocationRepository() { if (locationRepository == null) { locationRepository = new LocationRepository(); } return(locationRepository); }
public Form1() { managerRepository = new ManagerRepository(); clientRepository = new CilentRepository(); productRepository = new ProductRepository(); saleInfoRepository = new SaleInfoRepository(); InitializeComponent(); }
public CompositionRoot() { var mongoClient = new MongoClient(ConfigurationManager.ConnectionStrings["momani"].ConnectionString); _database = mongoClient.GetDatabase(ConfigurationManager.AppSettings["momaniDatabaseName"]); _componentsRepository = new MongoComponentsRepository(_database); _modelRepository = new MongoModelRepository(_database); _resultsRepository = new MongoResultsRepository(_database); }
/// <summary> /// Creates a new model repository with a given parent /// </summary> /// <param name="parent">The parent repository</param> /// <remarks>If no parent repository is provided, the meta repository is used as parent repository</remarks> public ModelRepository(IModelRepository parent) { models = new ModelRepositoryModelCollection(this); Locators = new List<IModelLocator>(); Locators.Add(FileLocator.Instance); Parent = parent ?? MetaRepository.Instance; Serializer = MetaRepository.Instance.Serializer; Parent.BubbledChange += Parent_BubbledChange; }
public void Apply(IModelRepository repository) { var parent = repository.Resolve(AbsoluteUri); var property = parent.GetType().GetProperty(CollectionPropertyName); var list = property.GetValue(parent, null) as IList; for (int i = Math.Min(StartingIndex + Count - 1, list.Count - 1); i >= StartingIndex; i--) { list.RemoveAt(i); } }
public Context(DbContext context = null, IUserRepository users = null, IUserProfileRepository profiles = null, IModelRepository models = null, IBrandRepository brands = null, ITypeRepository types =null, ICarRepository cars =null, IImageCarRepository imageCars =null) { _db = context ?? new CarDatabase(); Users = users ?? new UserRepository(_db,true); Profiles = profiles ?? new UserProfileRepository(_db, true); Models = models ?? new ModelRepository(_db, true); Brands = brands ?? new BrandRepository(_db, true); Types = types ?? new TypeRepository(_db, true); Cars = cars ?? new CarRepository(_db, true); ImageCars = imageCars ?? new ImageCarRepository(_db, true); }
//конструктор службы бизнес-логики использует в качестве параметров реализации интерфейсов репозиториев public EShopDataService(IModelRepository modelrepository, ICategoryRepository categoryRepository) { _modelRepository = modelrepository; _categoryRepository = categoryRepository; }
public ModelService(IModelRepository modelRepository, IProductService productService) { _modelRepository = modelRepository; _productService = productService; }
/// <summary> /// Applies all changes in this collection to the given repository. /// </summary> /// <param name="repository"></param> public void Apply(IModelRepository repository) { foreach (var change in Changes) change.Apply(repository); }
public void Apply(IModelRepository repository) { ///NMF automatically propagates the nested changes SourceChange.Apply(repository); }
public ParameterDataController(IModelRepository modelRepository) { _modelRepository = modelRepository; }
/// <summary> /// Initializes the specified model repository. /// </summary> /// <param name="modelRepository">The model repository.</param> public static void Initialize(IModelRepository modelRepository) { _current = modelRepository; }
public ComposedModelsController(IModelRepository modelRepository, IResultsRepository resultsRepository) { _modelRepository = modelRepository; _resultsRepository = resultsRepository; }
public BubbledChangeRepositoryFetcher(IModelRepository repository, IBubbledChangeFetcher parent) { Repository = repository; Parent = parent; }
public abstract void Run(IModelRepository repository);
public ScenariosController(IModelRepository modelRepository, IResultsRepository resultsRepository) { _modelRepository = modelRepository; _resultsRepository = resultsRepository; }
public void Apply(IModelRepository repository) { var element = repository.Resolve(AbsoluteUri); element.Delete(); }
public SetDataController(IModelRepository modelRepository) { _modelRepository = modelRepository; }
public void Apply(IModelRepository repository) { //NMF does this automatically when adding a new element to a parent }
public Model Deserialize(Stream source, Uri modelUri, IModelRepository repository, bool addToRepository) { var reader = XmlReader.Create(source); var root = CreateRoot(reader); var model = CreateModelForRoot(root); model.ModelUri = modelUri; if (addToRepository) repository.Models.Add(modelUri, model); var context = new ModelSerializationContext(repository, model); Initialize(reader, root, context); var idStore = new Dictionary<string, IModelElement>(); foreach (var pair in context.IDs) { var modelElement = pair.Value as IModelElement; if (modelElement != null && !idStore.ContainsKey(pair.Key)) { idStore.Add(pair.Key, modelElement); } } if (idStore.Count > 0) { model.IdStore = idStore; } context.Cleanup(); return model; }
public ModelSerializationContext(IModelRepository repository, Model root) : base(root) { Repository = repository; }
public ModelCloningController(IModelRepository modelRepository) { _modelRepository = modelRepository; }
public ModelCreator(IModelRepository repository) { this.repository = repository; }
public ModelService(IContext context) { _context = context; _models = context.Models; }
public ModelController(IModelRepository repository) { _repository = repository; }
public ScenarioCloningController(IModelRepository modelRepository) { _modelRepository = modelRepository; }