public static void AddSheetAtParticularIndex(string sheetName, int index, IUoW uow, int clientId, string sheetId, int apiKeySecretId = 20, int accountTypeId = 27) { try { var service = GetGoogleSpreadSheetService(uow, clientId, sheetId, apiKeySecretId, accountTypeId); // Add new Sheet var addSheetRequest = new AddSheetRequest(); addSheetRequest.Properties = new SheetProperties(); addSheetRequest.Properties.Title = sheetName; addSheetRequest.Properties.Index = index; BatchUpdateSpreadsheetRequest batchUpdateSpreadsheetRequest = new BatchUpdateSpreadsheetRequest(); batchUpdateSpreadsheetRequest.Requests = new List <Request>(); batchUpdateSpreadsheetRequest.Requests.Add(new Request { AddSheet = addSheetRequest }); var batchUpdateRequest = service.Spreadsheets.BatchUpdate(batchUpdateSpreadsheetRequest, sheetId); var response = batchUpdateRequest.Execute(); } catch (Exception ex) { throw; } }
public SheetsService GetGoogleSpreadSheetService(IUoW uow, int clientId, string sheetId, int apiKeySecretId, int accountTypeId) { try { var clientAccount = uow.ClientAccountRepository .Find(f => f.ClientId == clientId && f.AccountTypeId == accountTypeId && f.IsActive == true) .FirstOrDefault(); if (clientAccount != null) { var clientAPISecret = uow.ApiKeySecretRepository.Find(x => x.Id == apiKeySecretId).FirstOrDefault(); if (clientAPISecret != null) { var model = new GoogleUserCredential() { AccessToken = clientAccount.AccessToken, RefreshToken = clientAccount.RefreshToken, ClientId = clientAPISecret.ClientId, ClientSecret = clientAPISecret.ClientSecret, ApplicationName = "Flightdeck.Digital Service" }; var serviceInitializer = Credential.GetGoogleServiceInitializer(model); var service = new SheetsService(serviceInitializer); return(service); } } } catch (Exception ex) { GSheetReportingUtility.WriteLog($"GoogleSheet Service Error. Error Message is {ex.Message}", GSheetReportingLogType.GSheetReportingService); //WriteLogException(ex, FDGoogleMyBusinessLogType.FDGoogleDataStudioService); } return(null); }
public BaseAppService(IMediator mediator, IMapper mapper, IUoW uow) { this.mediator = mediator; this.mapper = mapper; UnitOfWork = uow; }
public BuyCattleHandler(IBusHandler bus, IHandleMessages <DomainNotification> notifications, IUoW uow, IBuyCattleRepository buyCattleRepository) : base(bus, notifications, uow) { _buyCattleRepository = buyCattleRepository; }
public UnicornController( IRepository <int, Unicorn> repository, IUoW uow) { //_logger = logger; _repository = repository; _uow = uow; }
public PhotoService( IUoW uow, IOptions <ImageOptionsModel> opt ) { _unitOfWork = uow; _widthOptions = opt; }
public BankAccountHandler(IBusHandler bus, IHandleMessages <DomainNotification> notifications, IUoW uow, IBankAccountRepository bankAccountRepository) : base(bus, notifications, uow) { _bankAccountRepository = bankAccountRepository; }
public AccountController( IOptions <TokenOptions> jwtOptions, IUoW uow, ICustomerRepository repository) : base(uow) { _repository = repository; _tokenOptions = jwtOptions.Value; ThrowIfInvalidOptions(_tokenOptions); }
protected CommandHandler(IBusHandler bus, IHandleMessages <DomainNotification> notifications, IUoW uow) { _notifications = (DomainNotificationHandler)notifications; _bus = bus; _uow = uow; }
public DailyExtractLotHandler(IBusHandler bus, IHandleMessages <DomainNotification> notifications, IUoW uow, IDailyExtractLotCreateDomainService dailyExtractLotCreateDomainService, IDailyExtractLotRepository dailyExtractLotRepository) : base(bus, notifications, uow) { _dailyExtractLotCreateDomainService = dailyExtractLotCreateDomainService; _dailyExtractLotRepository = dailyExtractLotRepository; }
public MapService( IUoW unitOfWork, IPhotoService photoService, IMapper mapper ) { _unitOfWork = unitOfWork; _photoService = photoService; _mapper = mapper; }
public DataBaseService(IEfGenericRepository <Movies> movies, IEfGenericRepository <Genres> genresRepo, IEfGenericRepository <Comments> commentsRepo, IEfGenericRepository <Users> userRepo, IEfGenericRepository <Likes> likesRepo, IEfGenericRepository <Dislikes> dislikesRepo, IUoW saver) { this.moviesRepo = movies; this.genresRepo = genresRepo; this.commentsRepo = commentsRepo; this.userRepo = userRepo; this.likesRepo = likesRepo; this.dislikesRepo = dislikesRepo; this.saver = saver; }
private void ConfigureDependencies() { var factory = new NHibernateFactory(); var factoryProxy = new NHibernateFactoryProxy(); factoryProxy.Initialize(factory.GetConfiguration, factory.GetSessionFactory); var nHibernateSession = new NHibernateSession(factoryProxy); _uow = new UoW(nHibernateSession); _service = new OrderService(_uow); }
public AccountController(IOptions <TokenOptions> jwtOptions, IUoW uow, ICustumerRepository repository) : base(uow) { _repository = repository; _tokenOptions = jwtOptions.Value; ThrowIfInvalidOptions(_tokenOptions); _serializerSettings = new JsonSerializerSettings { Formatting = Formatting.Indented, ContractResolver = new CamelCasePropertyNamesContractResolver() }; }
public UserService( IUoW uow, IMapper mapper, IMediator mediator, ICacheHelper cacheHelper, IPhotoService photoService) { _unitOfWork = uow; _mapper = mapper; _mediator = mediator; _cacheHelper = cacheHelper; _photoService = photoService; }
public AuthService( IMapper mapper, IUserService userService, IJwtSigningEncodingKey signingEncodingKey, IConfiguration configuration, IUoW unitOfWork ) { _mapper = mapper; _userService = userService; _signingEncodingKey = signingEncodingKey; _configuration = configuration; _unitOfWork = unitOfWork; }
public DatabaseFixture() { var x = Directory.GetCurrentDirectory(); var config = new ConfigurationBuilder() .AddJsonFile("appsettings.Tests.json", optional: true) .Build(); _options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(databaseName: "ProviderTests") .Options; _context = new ApplicationDbContext(_options); _context.Database.EnsureCreated(); Initialize(); _uow = new UoW(_context); }
public void TestInit() { kernel = DependencyInjectionConfig.CreateKernel(); context = kernel.Get <IMoviesContext>(); movies = new EfGenericRepository <Movies>(context); genresRepo = new EfGenericRepository <Genres>(context); commentsRepo = new EfGenericRepository <Comments>(context); userRepo = new EfGenericRepository <Users>(context); likesRepo = new EfGenericRepository <Likes>(context); dislikesRepo = new EfGenericRepository <Dislikes>(context); saver = new UoW(context); context.Genres.Add(genre); context.SaveChanges(); }
public SeedController( IExameRepository exameRepository, IMedicoRepository medicoRepository, IOrdemServicoRepository ordemServicoRepository, IPacienteRepository pacienteRepository, IPostoColetaRepository postoColetaRepository, IUoW uow) { _exameRepository = exameRepository; _medicoRepository = medicoRepository; _ordemServicoRepository = ordemServicoRepository; _pacienteRepository = pacienteRepository; _postoColetaRepository = postoColetaRepository; _uow = uow; }
public void SetUp() { var config = ContainerConfig.Configure(); using (var scope = config.BeginLifetimeScope()) { _testSettings = scope.Resolve <ApplicationConfiguration>().GetApplicationConfiguration <TestSettings>(); _log = scope.Resolve <ILog>(); _browser = scope.Resolve <IBrowserFactory>(new TypedParameter(typeof(ILog), _log)); _browser.Start(_testSettings.Browser); _pages = scope.Resolve <IUoW>(new NamedParameter("_driver", _browser.GetDriver()), new NamedParameter("_testSettings", _testSettings), new NamedParameter("_log", _log)); } }
public static GoogleDataStudioResponse GetGoogleSpreadSheetDetail(IUoW uow, int clientId, string sheetId, int apiKeySecretId = 20, int accountTypeId = 27) { var response = new GoogleDataStudioResponse(); try { var service = GetGoogleSpreadSheetService(uow, clientId, sheetId, apiKeySecretId, accountTypeId); var spreadsheet = service.Spreadsheets.Get(sheetId).Execute(); response.Spreadsheet = spreadsheet; response.SheetFileName = spreadsheet.Properties.Title; response.SheetId = spreadsheet.SpreadsheetId; response.HasError = false; } catch (Exception ex) { response.HasError = true; WriteLogException(ex, FDGoogleMyBusinessLogType.FDGoogleDataStudioService); } return(response); }
public HashesController(IUoW unit) { _unit = unit; }
public UrlService(IUoW uow, IUrlhandler handler) { _uow = uow; _handler = handler; }
public ExceptionService() { db = new UoW(); }
public ExceptionService(IUoW <ApplicationContext> db) { this.db = db ?? new UoW(); }
public MoneyController(IBudgetRepository budgetRepository, IUoW uow, IClock clock) { _budgetRepository = budgetRepository; _uow = uow; _clock = clock; }
public UserServices(IUoW uow, IUserRepo userRepo) { _uow = uow; _userRepo = userRepo; }
public CourseController(IUoW uow) : base(uow) { }
public AdminController(IRepository <int, Unicorn> repository, IOwnerRepository ownerRepository, IUoW uow) { _repository = repository; _ownerRepository = ownerRepository; _uow = uow; }
protected PersistentRepository(IUoW uow) { this._uow = uow; }
public InstructorController(IUoW uow) : base(uow) { }
public CollectionViewModel() { _uoW = Bootstrapper.Container.Resolve <IUoW>(); Items = new ObservableCollection <T>(); }