public LmsDashboardServiceTest() { _iDbService = Substitute.For<IDbService>(); FakeDbService(); _iLmsDashboardService=new LmsDashboardService(); _iLmsDashboardService = new LmsDashboardService(_iDbService); }
public ChatBackup(CloudStorageAccount storageAccount) { var client = storageAccount.CreateCloudTableClient(); _table = client.GetTableReference("Chat"); _table.CreateIfNotExists(); _iDbService = new DbService(); _retryPolicy = _iDbService.GetRetryPolicy(); }
public PostBackup(CloudStorageAccount storageAccount, string endpointUrl, string authorizationKey) { _iDbService = new DbService(endpointUrl,authorizationKey); CloudTableClient c = storageAccount.CreateCloudTableClient(); _table = c.GetTableReference("Post"); _table.CreateIfNotExists(); _retryPolicy = _iDbService.GetRetryPolicy(); }
public PostBackup(CloudStorageAccount storageAccount) { _iDbService = new DbService(); CloudTableClient c = storageAccount.CreateCloudTableClient(); _table = c.GetTableReference("Post"); _table.CreateIfNotExists(); _retryPolicy = RetryService.GetRetryPolicy(); }
public Dichotomy(string endpointUrl, string authorizationKey) { _client = new DocumentClient(new Uri(endpointUrl), authorizationKey); _database = _client.CreateDatabaseQuery().Where(db => db.SelfLink == ConfigurationManager.AppSettings["DBSelfLink"]) .AsEnumerable().FirstOrDefault(); _iDbService = new DbService(); }
public Dichotomy(string endpointUrl, string authorizationKey) { _client = new DocumentClient(new Uri(endpointUrl), authorizationKey); _database = _client.CreateDatabaseQuery().Where(db => db.Id == CloudConfigurationManager.GetSetting("Database")) .AsEnumerable().FirstOrDefault(); _iDbService = new DbService(); }
private void Init() { //Get DBservice _databaseSelfLink = _databaseSelfLink ?? ConfigurationManager.AppSettings["DBSelfLink"]; _iDbService = _iDbService ?? new DbService(); //Init DB and Firebase _client = _client ?? _iDbService.GetFirebaseClient(); }
public ProcessMessage(DbService iDbService, QueueService iQueueService) { _documentClient = iDbService.GetDocumentClient(); _client = iDbService.GetFirebaseClient(); //_documentCollection = iDbService.GetDc("LMSCollection", "LMSRegistry"); _documentCollection = null; _iDbService = iDbService; _queue = iQueueService.GetQueue("queue"); }
// Please set the following connection strings in app.config for this WebJob to run: // AzureWebJobsDashboard and AzureWebJobsStorage public static void Main(string[] args) { LogHelper.ConfigureLogging(); Log.Information("Build Number: {buildNumber}", typeof(Program).Assembly.GetName().Version); var kernel = ConfigureServices(); _dbService = kernel.Get<IDbService>(); var jobHost = new JobHost(); jobHost.Call(typeof(Program).GetMethod("EmailNotificationDaily")); }
static void Main(string[] args) { LogHelper.ConfigureLogging(); Console.WriteLine("Build Number: {0}", typeof(Program).Assembly.GetName().Version); var kernel = ConfigureServices(); _dbService = kernel.Get<IDbService>(); var jobHost = new JobHost(); jobHost.Call(typeof(Program).GetMethod("EmailNotifications")); }
private void Init() { _run = true; //Get DBservice _databaseSelfLink = _databaseSelfLink ?? CloudConfigurationManager.GetSetting("DBSelfLink"); _iDbService = _iDbService ?? new DbService(); //Init DB and Firebase _client = _client ?? _iDbService.GetFirebaseClient(); //check resolver state lock (Object) { if (_n <= 0) return; _n--; Task.Run(() => CheckResolver()); } }
public static async Task GetStartedDemo() { // Create a new instance of the DocumentClient. var client = Swap(2); var database = await GetDB(client, db); var documentCollection = await GetDC(client, database); _iDbService = new DbService(); //await DeleteAll(client, database, documentCollection); await Resolver(documentCollection, client, database); //await GetData(client, documentCollection); //ReadData(client, documentCollection); //await WriteData(client, documentCollection); Console.ReadLine(); /*await client.DeleteDatabaseAsync(database.SelfLink); client.Dispose();*/ }
public static async Task GetStartedDemo() { // Create a new instance of the DocumentClient. DocumentClient client = new DocumentClient(new Uri(EndpointUrl), AuthorizationKey); var database = await GetDB(client); var documentCollection = await GetDC(client, database); //var response = await ExecuteWithRetries(5, () => client.CreateDocumentAsync("", new object())); //await DeleteAll(client, database, documentCollection); _iDbService = new DbService(EndpointUrl,AuthorizationKey); await sp2(documentCollection, client, database); //await GetData(client, documentCollection); //ReadData(client, documentCollection); //await WriteData(client, documentCollection); Console.ReadLine(); /*await client.DeleteDatabaseAsync(database.SelfLink); client.Dispose();*/ }
private void Init() { _run = true; //Get DBservice _endpointUrl = _endpointUrl ?? CloudConfigurationManager.GetSetting("DocumentDBUrl"); _authorizationKey = _authorizationKey ?? CloudConfigurationManager.GetSetting("DocumentDBAuthorizationKey"); _databaseSelfLink = _databaseSelfLink ?? CloudConfigurationManager.GetSetting("DBSelfLink"); _iDbService = _iDbService ?? new DbService(_endpointUrl, _authorizationKey); //Init DB and Firebase _client = _client ?? _iDbService.GetFirebaseClient(); //check resolver state lock (_object) { if (n <= 0) return; n--; Task.Run(() => CheckResolver()); } }
//Constructor for service public LmsDashboardService() { _iDbService = new DbService(); }
public ReportService(IMapper mapper, IDbService dbService) : base(mapper, dbService) { }
public static void ProcessEmails(IDbService dbService, bool immediate) { var sendEmail = CloudConfigurationManager.GetSetting("send-email"); var testEmail = CloudConfigurationManager.GetSetting("send-test-emails"); var errorCount = 0; var successCount = 0; var log = Log.ForContext("jobid", Guid.NewGuid()); //Don't execute unless email is turned on if (!string.Equals(sendEmail, "Yes", StringComparison.InvariantCultureIgnoreCase)) { Console.WriteLine("No emails sent because send-email is not set to 'Yes'"); log.Information("No emails sent because send-email is not set to 'Yes'"); return; } using (var connection = dbService.GetConnection()) { List<dynamic> pending = connection.Query(@" select emailqueue.id as id, [subject], [body], students.email as sEmail, registrations.email as rEmail from emailqueue inner join Students on students.Id = EmailQueue.Student_Id LEFT OUTER JOIN Registrations on registrations.id = EmailQueue.RegistrationId where Pending = 1 and [immediate] = @immediate", new { immediate }).ToList(); if (pending.Any()) { log.Information("{count} pending emails found", pending.Count); } foreach (var email in pending) { var emailTransmission = new Transmission { Content = new Content { From = new Address { Email = "*****@*****.**", Name = "UCD Commencement Notification" }, Subject = email.subject , Html = email.body } }; if (!string.IsNullOrWhiteSpace(testEmail)) { emailTransmission.Recipients.Add(new Recipient { Address = new Address { Email = testEmail } }); } else { emailTransmission.Recipients.Add(new Recipient { Address = new Address { Email = email.sEmail } }); if (!string.IsNullOrWhiteSpace(email.rEmail)) { emailTransmission.Recipients.Add(new Recipient { Address = new Address { Email = email.rEmail } }); } } var client = new Client(SparkPostApiKey); DateTime? sentDateTime = null; try { client.Transmissions.Send(emailTransmission).Wait(); sentDateTime = DateTime.UtcNow; //TODO: Pacific time it? successCount++; } catch (Exception ex) { //TODO: Logging. Console.WriteLine(string.Format("Exception Detected: {0}", ex.GetBaseException())); // Log.Error(ex, "There was a problem emailing {email}", email.sEmail); //I don't think we care if there are a few problems... errorCount++; log.Error(ex, ex.GetBaseException().ToString()); } if (string.IsNullOrWhiteSpace(testEmail)) { using (var ts = connection.BeginTransaction()) { //Update the db connection.Execute(@" UPDATE EmailQueue SET [Pending] = 0 ,[SentDateTime] = @sentDateTime WHERE id = @id", new { sentDateTime, id = email.id }, ts); ts.Commit(); } } } Console.WriteLine(string.Format("Sent: {0} Errors: {1}", successCount, errorCount)); log.Information("Sent: {successCount} Errors: {errorCount}", successCount, errorCount); } }
public AccessQueryService(IDbService dbService) { _dbService = dbService; }
public StudentController(IDbService service) { db = service; }
public EnrollmentController(IDbService dbService, StudentContext studentContext) { _dbService = dbService; _studentContext = studentContext; }
public HomeController(IDbService dbServiceParam) { dbService = dbServiceParam; }
public UserController(IDbService service) { _service = service; }
public PushNotificationService(IConfiguration configuration, IDbService dbService) { _serverKey = configuration.GetSection("FCM:ServerKey").Value; this.dbService = dbService; }
public RoomDac(IDbService service) { Collection = service.CollectionRoom; }
public SkillDomain(DbContext dbContext, IDbService dbService) { _dbContext = (CvManagementDbContext)dbContext; _dbService = dbService; }
public StudentsController(IDbService dbService, IStudentDbService studentDbService, IConfiguration configuration) { _dbService = dbService; _studentDbService = studentDbService; Configuration = configuration; }
public ExamController(IDbService <Exam> service) { _service = service; }
public OAuthValidator(IDbService dbService) { _dbService = dbService; }
public AccountRepository(IDbService dbService, IMapperFactory mapperFactory, Expression <Func <User, bool> > filters) : base(dbService, mapperFactory) { _filters = filters; }
public StudentsController(IDbService idbService, IConfiguration configuration) { this.idbService = idbService; this.configuration = configuration; }
public ReservationDac(IDbService service) { Collection = service.CollectionReservation; }
public EnrollmentController(IDbService dbService) { _dbService = dbService; }
public ZawodyController(IDbService service) { _service = service; }
public DoctorController(IDbService service) { this.service = service; }
public FRAAdapter(IHttpService httpService, IDbService dbService) : base(httpService, dbService) { }
public AdultsController(IDbService service) { this.service = service; service.RunDbSetup(); adultContext = new DataContext(); }
public MainViewModel(IDbService service) { _service = service; Initialize(); }
public PlagiarismController(IDbService dbService, CompareService compareService) { _dbService = dbService; _compareService = compareService; }
public EnrollmentsController(IDbService <Enrollment> dbService, IDbService <Study> studyDbService, IDbService <Student> studentdbService) { _dbService = dbService; _studyDbService = studyDbService; _studentdbService = studentdbService; }
public WarehouseController(IDbService DbService) { this.DbService = DbService; }
public void TestInitialize() { _sqlConnection =new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\Dev\2015\gvtrunk\gvtrunk\web_root\wsRethink\PCG.GOAL.WebService\App_Data\GoalServiceDb.mdf;Integrated Security=True"); _dbService = new DbService(new SqlDataAccess(_sqlConnection)); _adminController = new ServiceAdminController(_dbService); }
public PatientsController(IDbService service) { this.service = service; }
public SearchController(IRepositoryWithTypedId<People, string> peopleRepository, IDbService dbService) { _peopleRepository = peopleRepository; _dbService = dbService; }
public LoadBalance() { _iDbService = _iDbService ?? new DbService(); }
//Constructor for Api public LmsDashboardService(IDbService iDbService) { _iDbService = iDbService; }
internal BackupManager(IDbService dbService, IGitWrapper gitWrapper) { this.dbService = dbService; this.gitWrapper = gitWrapper; }
public LmsController(IDbService iDbService, ILmsDashboardService iLmsDashboardService) { _iDbService = iDbService; _iLmsDashboardService = iLmsDashboardService; }
private static void FakeDbService() { _iDbService = Substitute.For<IDbService>(); _iDbService.Firebase.GetFirebaseToken("12", "aotuo", Arg.Any<string>()).Returns("token"); }
public NoviRN3ViewModel(IDbService dbService, IRegionManager regionManager) { _dbService = dbService; _regionManager = regionManager; FormirajListuStatusa(); }
public AccountRepository(IDbService dbService, IMapperFactory mapperFactory) : base(dbService, mapperFactory) { }
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { DbService = ServiceLocator.Current.GetInstance<IDbService>(); base.Initialize(name, config); }
public StopCommand(IDbService dbService) : base(dbService, EntryType.Stop) { }
public HistoryAjaxController(IQueryRepositoryFactory queryRepositoryFactory, IOrderService orderService, IDbService dbService) { _queryRepositoryFactory = queryRepositoryFactory; _orderService = orderService; _dbService = dbService; }
public StudentsController(IDbService service) { _dbService = service; }
public StudentsController(IDbService db) { _dbService = db; }
public ProjectCommand(IDbService dbService) : base(dbService, EntryType.Project) { }
public StatsController(IDbService dbService) { _dbService = dbService; }
public IActionResult PromoteSemester([FromBody] StudiesInfo studies, [FromServices] IDbService dbService) { return(dbService.promoteStudents(studies)); }
public AssignmentController(IAssignmentService assignmentService, IDbService <Invoice> invoiceService, IDbService <AssignmentStatus> assignmentStatusService, IUnitOfWork uow, IDbService <Customer> customerService, IUploadFileService uploadFileService, IDbService <Adjustment> overpaymentService, IDbService <InvoiceAttachment> invoiceAttachmentService, IDbService <Attachment> attachmentService) { _assignmentService = assignmentService; _invoiceService = invoiceService; _assignmentStatusService = assignmentStatusService; _customerService = customerService; _overpaymentService = overpaymentService; _invoiceAttachmentService = invoiceAttachmentService; _attachmentService = attachmentService; _uploadFileService = uploadFileService; _uow = uow; }
public SOStringService(IDbService dbService, IUserService userService, IConfiguration configuration) { _dbService = dbService; _userService = userService; _configuration = configuration; }