protected BaseRepo(FirestoreConfig firestoreConfig, ILogger logger)
        {
            log    = logger;
            config = firestoreConfig;
            if (config.Emulator)
            {
                if (string.IsNullOrEmpty(config.EmulatorUrl))
                {
                    throw new MissingFieldException(nameof(config.EmulatorUrl));
                }


                var fb = new FirestoreDbBuilder
                {
                    ProjectId = config.ProjectId,
                    //Endpoint = config.EmulatorUrl,
                    EmulatorDetection = EmulatorDetection.EmulatorOnly
                };

                db = fb.Build();
                return;
            }
            db = FirestoreDb.Create(config.ProjectId);
        }
Example #2
0
 private void Connect(FirestoreConfig firestoreConfig)
 {
     //connect here
 }
Example #3
0
 public FirestoreClient(IOptions <FirestoreConfig> options)
 {
     _config = options.Value;
 }
Example #4
0
 public BlogRepo(FirestoreConfig firestoreConfig, ILogger <BlogRepo> logger) :
     base(firestoreConfig, logger)
 {
 }