Exemple #1
0
        public static async Task <IDataPortal> CreateLocalDataPortal()
        {
            var jsonImporter = JsonDataImporter.CreateJsonDataImporter();
            var jsonSaver    = JsonSaver.CreateJsonSaver();

            await Task.WhenAll(jsonImporter, jsonSaver);

            return(new LocalDataPortal(jsonImporter.Result, jsonSaver.Result));
        }
Exemple #2
0
        IEnumerator Start()
        {
            yield return(new WaitForEndOfFrame());

            jsonDataImporter = this.gameObject.GetComponent <JsonDataImporter>();

            if (jsonDataImporter.poseData)
            {
                StartCoroutine(CameraLookAt());
            }
        }
Exemple #3
0
        public static void Main(string[] args)
        {
            var host = BuildWebHost(args);

            using (var scope = host.Services.CreateScope())
            {
                var services = scope.ServiceProvider;

                var builder = new ConfigurationBuilder()
                              .SetBasePath(Directory.GetCurrentDirectory())
                              .AddJsonFile("appsettings.json");
                Configuration = builder.Build();

                // As we are using an in-memory database for this exercise we must seed it on start-up.
                // In a real-world application this would be unnecessary
                var dataFilename     = Configuration["Data:TestDataFilename"];
                var personRepository = services.GetService <IPersonRepository>();
                var importer         = new JsonDataImporter(personRepository);
                importer.LoadPeopleFromJsonFile(dataFilename).Wait();
            }

            host.Run();
        }