private FaciTechDbContext GetConnection() { var config = GetConfigEntry(); var connectionString = config.GetConnectionString("FacitechDb"); DbContextOptionsBuilder dbContextOptionsBuilder = new DbContextOptionsBuilder(); Guid userId = Guid.Parse("09883535-d262-4c9b-8957-785636728445"); var dbContext = new FaciTechDbContext(dbContextOptionsBuilder.UseSqlServer(connectionString).Options); dbContext.UserId = userId; return(dbContext); }
public static T CreateService <T>(FaciTechDbContext context) where T : new() { var targetService = new T(); FacitechBusinessService facitechBusinessService = targetService as FacitechBusinessService; if (facitechBusinessService != null) { facitechBusinessService._faciTechDbContext = context; facitechBusinessService.OnInt(); } return(targetService); }
public static T Create <T>(FaciTechDbContext faciTechDbContext, Guid userId, Guid?contactId = null) where T : new() { var targetService = new T(); FacitechBusinessService facitechBusinessService = targetService as FacitechBusinessService; if (facitechBusinessService != null) { facitechBusinessService.UserId = userId; if (contactId.HasValue) { facitechBusinessService.ContactId = contactId.Value; } facitechBusinessService._faciTechDbContext = faciTechDbContext; facitechBusinessService.OnInt(); } return(targetService); }
public static int GenerateSequence(this FaciTechDbContext faciTechDbContext, string key) { var numberGenerator = faciTechDbContext.NumberGenerator.Where(e => e.Key == key).FirstOrDefault(); if (numberGenerator == null) { numberGenerator = new Database.Models.NumberGenerator() { Key = key, Number = 1 }; faciTechDbContext.NumberGenerator.Add(numberGenerator); } else { numberGenerator.Number++; } faciTechDbContext.SaveChanges(); return(numberGenerator.Number); }
public InvoiceSetupScheduleController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { }
public ConsumptionRateCalculator(FaciTechDbContext faciTechDbContext, Guid consumptionId) { _faciTechDbContext = faciTechDbContext; this._consumptionId = consumptionId; }
//private LocationService _locationService; public NotificationTypesController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { //_locationService = CreateService<LocationService>(); }
public UnitContactsController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { _faciTechDbContext = faciTechDbContext; this._unitContactService = CreateService <UnitContactService>(); this._unitContactMapper = new UnitContactMapper(); }
public SubAreasController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { }
public TicketsController(FaciTechDbContext faciTechDbContext, IMapper mapper) : base(faciTechDbContext, mapper) { _ticketMapper = new TicketMapper(mapper); }
public AssociationController(FaciTechDbContext faciTechDbContext, IMapper mapper) : base(faciTechDbContext, mapper) { _associationService = CreateService <AssociationService>(); }
public InvoiceSetupGeneratorTask(FaciTechDbContext faciTechDbContext) { _faciTechDbContext = faciTechDbContext; }
public StatesController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { }
public CommunityController(FaciTechDbContext faciTechDbContext, IMapper mapper) { _faciTechDbContext = faciTechDbContext; _locationService = new LocationService(_faciTechDbContext); _mapper = mapper; }
public HierarchyProviderFactory(FaciTechDbContext faciTechDbContext, Guid communityId) { this._faciTechDbContext = faciTechDbContext; this.communityId = communityId; }
public AssetsController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { _assetMapper = new AssetMapper(); }
public CountriesController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { }
public DirectMessageController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { }
public MaintenanceRatesController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { _maintenanceRateMapper = new MaintenanceRateMapper(); }
public ServiceController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { }
public SectionsController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { _sectionService = CreateService <SectionService>(); }
public SubAreasController(FaciTechDbContext faciTechDbContext) { _faciTechDbContext = faciTechDbContext; }
public StaffController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { _staffMapper = new StaffMapper(); }
public UnitsController(FaciTechDbContext faciTechDbContext, IMapper mapper) : base(faciTechDbContext, mapper) { this._unitMapper = new UnitMapper(mapper); }
public LocationHierarchyProvider(FaciTechDbContext faciTechDbContext) { this._faciTechDbContext = faciTechDbContext; }
public AmenitiesController(FaciTechDbContext faciTechDbContext, IMapper mapper) : base(faciTechDbContext, mapper) { _amenityMapper = new AmenityMapper(mapper); }
public NotificationController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { }
public FacitechBusinessService(FaciTechDbContext faciTechDbContext) { this._faciTechDbContext = faciTechDbContext; }
public AmcsController(FaciTechDbContext faciTechDbContext) : base(faciTechDbContext) { _amcMapper = new AmcMapper(); }
public MaintenanceRateCalculator(FaciTechDbContext faciTechDbContext, Guid communityId) { _faciTechDbContext = faciTechDbContext; this._communityId = communityId; }