Пример #1
0
 public SenderInfo LoadConfiguration()
 {
     using (MSContext context = new MSContext())
     {
         return(context.SenderInfos.FirstOrDefault());
     }
 }
Пример #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, MSContext dataContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });

            dataContext.Database.Migrate();
        }
        public ReservationService(IConfigurationRoot root, MSContext context)
        {
            _db = context;
            var config = root.GetSection("SmtpConfig");

            _email    = config["email"];
            _password = config["password"];
            _host     = config["host"];
        }
Пример #4
0
 private void EnsureDataBaseReady(MSContext context)
 {
     try
     {
         context.Database.EnsureCreated();
         context.Database.Migrate();
     }
     catch (Exception ex)
     {
         context.Database.EnsureDeleted();
         context.Database.Migrate();
     }
 }
Пример #5
0
        static void Main(string[] args)
        {
            MSContext.Initialize(new Registrar(),
                                 new Infrastructure.Messaging.Registrar(),
                                 new Infrastructure.Handling.Registrar(),
                                 new Employees.Registrar(),
                                 new Employees.Worker.Registrar());
            MSContext.Verify();

            var messageChannel = MSContext.Resolve <IMessageChannel>();

            messageChannel.Startup();
            Console.WriteLine("Started worker...");
            Console.WriteLine("Press key to exit!");
            Console.ReadLine();
            messageChannel.Dispose();
        }
Пример #6
0
        public void SaveConfiguration(SenderInfo senderInfo, string password)
        {
            using (MSContext context = new MSContext())
            {
                var si = context.SenderInfos.FirstOrDefault();
                if (si == null)
                {
                    si = context.SenderInfos.Create();
                    context.SenderInfos.Add(si);
                }
                si.FromEmail   = senderInfo.FromEmail;
                si.DisplayName = senderInfo.DisplayName;
                si.User        = senderInfo.User;
                si.SetPassword(password);
                si.Smtp             = senderInfo.Smtp;
                si.Port             = senderInfo.Port;
                si.SecureConnection = senderInfo.SecureConnection;

                context.SaveChanges();
            }
        }
 public InitialReportsController(MSContext context)
 {
     _context = context;
 }
 public EmployeesController(MSContext context)
 {
     _context = context;
 }
Пример #9
0
 public ClienteRepository(MSContext ctx) : base(ctx)
 {
     this.ctx = ctx;
 }
Пример #10
0
 public BaseRepository(MSContext context, DbSet <TEntity> dataSet)
 {
     Db    = context;
     DbSet = dataSet;
 }
Пример #11
0
 public MobileRepository(MSContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public GetMerchantQueryHandler(MSContext context)
 {
     _context = context;
 }
Пример #13
0
 public DeleteMerchantCommandHandler(MSContext context)
 {
     _context = context;
 }
Пример #14
0
 public PostMerchantCommandHandler(MSContext context)
 {
     _context = context;
 }
Пример #15
0
 public AccountService(UserManager <User> userManager, MSContext context)
 {
     _userManager = userManager;
     _db          = context;
 }
Пример #16
0
 public UserService(MSContext context)
 {
     _context = context;
 }
Пример #17
0
 public RatingService(MSContext context)
 {
     _db = context;
 }
Пример #18
0
 public PriceListService(MSContext db)
 {
     _db = db;
 }
 public BaseRepository(MSContext context)
 {
     this.context = context;
     entity_      = context.Set <T>();
 }
Пример #20
0
 public SeguidorRepository(MSContext context) : base(context)
 {
 }
Пример #21
0
 public ClientsController(MSContext context)
 {
     _context = context;
 }
Пример #22
0
 public GameService(MSContext context)
 {
     _context = context;
 }
Пример #23
0
 public TestService(MSContext context)
 {
     _context = context;
 }
Пример #24
0
 public AnswerService(MSContext context)
 {
     _context = context;
 }
Пример #25
0
 public UnitOfWork(MSContext context)
 {
     _dbContext = context;
 }