コード例 #1
0
ファイル: Facturas.cs プロジェクト: Ernestolebni101/Ferreto
 public ReimprimirBo()
 {
     InitializeComponent();
     timer1.Start();
     _context       = Initializecontext.initcontext();
     _detallehelper = new ServicesInjector <Detallefactura>(_context);
 }
コード例 #2
0
        public static void RegisterServices(IServiceCollection services)
        {
            var mappingConfig = new MapperConfiguration(mc =>
            {
                mc.AddProfile(new ServicesMapperProfile());
            });

            IMapper mapper = mappingConfig.CreateMapper();

            services.AddSingleton(mapper);

            RepositoriesInjector.RegisterServices(services);
            ServicesInjector.RegisterServices(services);

            var key = Encoding.ASCII.GetBytes(SecuritySettings.Secret);

            services.AddAuthentication(x =>
            {
                x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                x.DefaultChallengeScheme    = JwtBearerDefaults.AuthenticationScheme;
            })
            .AddJwtBearer(x =>
            {
                x.RequireHttpsMetadata      = false;
                x.SaveToken                 = true;
                x.TokenValidationParameters = new TokenValidationParameters
                {
                    ValidateIssuerSigningKey = true,
                    IssuerSigningKey         = new SymmetricSecurityKey(key),
                    ValidateIssuer           = false,
                    ValidateAudience         = false
                };
            });
        }
コード例 #3
0
 public ProveedoresForm()
 {
     InitializeComponent();
     timer1.Start();
     _context           = Initializecontext.initcontext();
     _proveedoreshelper = new ServicesInjector <Persona>(_context);
     InitLv();
 }
コード例 #4
0
ファイル: Compras.cs プロジェクト: Ernestolebni101/Ferreto
 public Compras()
 {
     InitializeComponent();
     _context       = Initializecontext.initcontext();
     _compraservice = new ServicesInjector <Compra>(_context);
     timer1.Start();
     Init();
 }
コード例 #5
0
 public EditarCuenta()
 {
     InitializeComponent();
     _context          = Initializecontext.initcontext();
     _usuariohelper    = new ServicesInjector <Usuario>(_context);
     _rolhelper        = new ServicesInjector <Rol>(_context);
     _rolusuariohelper = new ServicesInjector <Rolusuario>(_context);
     Init();
 }
コード例 #6
0
        private void ConfigureInjection(IServiceCollection services)
        {
            services.AddSingleton(ConfigureMapper());

            services.AddScoped <IDbConnection>(_ => GetConnection());
            AcceInjector.Config(services);
            ServicesInjector.Config(services);
            RepositoriesInjector.Config(services);
        }
コード例 #7
0
        public static void AddDependencyInjectionConfiguration(this IServiceCollection services)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            ServicesInjector.RegisterServices(services);
        }
コード例 #8
0
 public Catalogo()
 {
     InitializeComponent();
     timer1.Start();
     _context              = Initializecontext.initcontext();
     _inventariohelper     = new ServicesInjector <Inventario>(_context);
     _precioproductohelper = new ServicesInjector <Precioproducto>(_context);
     _productohelper       = new ServicesInjector <Producto>(_context);
     InitList();
 }
コード例 #9
0
ファイル: Startup.cs プロジェクト: rafbaptista/UserAPI
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages().AddRazorRuntimeCompilation();

            //Database Settings
            services.AddDatabaseConfiguration(Configuration);

            //Transient/scoped/singleton services
            ServicesInjector.RegisterServices(services);
        }
コード例 #10
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            //API Configs
            services.AddControllers();

            //Database configs
            services.AddDatabaseConfiguration(Configuration);

            //Transient/scoped/singleton services
            ServicesInjector.RegisterServices(services);
        }
コード例 #11
0
 public CompraExistente()
 {
     InitializeComponent();
     _context            = Initializecontext.initcontext();
     _productoservices   = new ServicesInjector <Producto>(_context);
     _proveedorservices  = new ServicesInjector <Proveedores>(_context);
     _inventarioservices = new ServicesInjector <Inventario>(_context);
     _compraservices     = new ServicesInjector <Compra>(_context);
     _precioservices     = new ServicesInjector <Precioproducto>(_context);
     _comprahelper       = new Helper <Compra>(_context);
     Init();
 }
コード例 #12
0
 public CompraNueva()
 {
     InitializeComponent();
     _context            = Initializecontext.initcontext();
     _productohelper     = new Helper <Producto>(_context);
     _comprahelper       = new Helper <Compra>(_context);
     _categoriahelper    = new Helper <Categoria>(_context);
     _marcahelper        = new Helper <Marca>(_context);
     _presentacionhelper = new Helper <Presentacion>(_context);
     _proveedorhelper    = new ServicesInjector <Proveedores>(_context);
     _usuariohelper      = new Helper <Usuario>(_context);
     _preciohelper       = new Helper <Precioproducto>(_context);
     _inventariohelper   = new Helper <Inventario>(_context);
     Initialize();
 }