Beispiel #1
0
        public PortfoliosController()
        {
            var mongoWrapper  = new MongoClientWrapper(new ConnectionStringProvider());
            var clientFactory = new AlphaVantageStocksClientFactory(new ApiKeyProvider());

            //var iexClient = new IEXClient();

            _portfolioDataAccess = new PortfolioDataAccess(mongoWrapper);
            _alphaClientLogic    = new AlphaClientLogic(new AlphaClientWrapper(clientFactory), new StockDataAccess(mongoWrapper));
            _rebalanceLogic      = new RebalanceLogic.RebalanceLogic();
        }
Beispiel #2
0
 public DeploymentController(IDataMapper mapper,
                             SimulatorFamilyRepository simulatorFamilyRepository,
                             SceneRepository sceneRepository,
                             ILogger <DeploymentController> logger,
                             MongoClientWrapper clientWrapper,
                             SimulatorLocalizationRepository localizationRepository)
 {
     this.mapper = mapper;
     this.simulatorFamilyRepository = simulatorFamilyRepository;
     this.sceneRepository           = sceneRepository;
     this.logger                 = logger;
     this.clientWrapper          = clientWrapper;
     this.localizationRepository = localizationRepository;
 }
        public async Task Execute()
        {
            string connectionString = "mongodb+srv://mikino55:[email protected]/test?retryWrites=true&w=majority";

            MongoDefaults.GuidRepresentation = MongoDB.Bson.GuidRepresentation.Standard;
            //DB db = new DB(
            //    MongoClientSettings.FromConnectionString("mongodb+srv://mikino55:[email protected]/test?retryWrites=true&w=majority"),
            //    "VirtaMed");
            //var database = db.GetDatabase();
            //database.DropCollection("Person");

            MongoClientWrapper clientWrapper = new MongoClientWrapper(connectionString);
            //MongoClient client = new MongoClient(connectionString);
            //IMongoDatabase database = client.GetDatabase("VirtaMed");
            //database.CreateCollection("Person");
            //IMongoCollection<SimulatorFamily> collection = database.GetCollection<SimulatorFamily>("SimulatorFamily");
            SimulatorFamilyRepository repository = new SimulatorFamilyRepository(clientWrapper);

            //database.CreateCollection("SimulatorFamily");

            SimulatorFamily family = new SimulatorFamily
            {
                //Identifier = Guid.NewGuid(),
                Identifier      = Guid.Parse("177c20f1-e443-4646-af54-5850a481a8ee"),
                NameLanguageKey = "Arthros",
                Simulators      = new List <Simulator>
                {
                    new Simulator
                    {
                        Identifier      = Guid.Parse("d92b4ae1-680d-48e5-96ee-6acbb91d90cf"),
                        NameLanguageKey = "Arthros",
                        Version         = "1.0.0.0",
                        SceneSections   = new List <SceneSection>
                        {
                            new SceneSection
                            {
                                Identifier      = Guid.NewGuid(),
                                NameLanguageKey = "Section language key",
                            }
                        }
                    }
                }
            };
            //await repository.UpsertAndAddSimulator(family, null);
            //var result = family.Save();
            //collection.InsertOne(p);
        }
 public SimulatorLocalizationRepository(MongoClientWrapper clientWrapper) : base(clientWrapper)
 {
 }
 public CourseRepository(MongoClientWrapper clientWrapper) : base(clientWrapper)
 {
 }
 public RepositoryBase(MongoClientWrapper clientWrapper)
 {
     this.Collection = clientWrapper.Database.GetCollection <TEntity>(this.CollectionName);
 }
Beispiel #7
0
 public SceneRepository(MongoClientWrapper clientWrapper) : base(clientWrapper)
 {
 }
Beispiel #8
0
 public SimulatorFamilyRepository(MongoClientWrapper clientWrapper) : base(clientWrapper)
 {
 }