public SenderInfo LoadConfiguration() { using (MSContext context = new MSContext()) { return(context.SenderInfos.FirstOrDefault()); } }
// 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"]; }
private void EnsureDataBaseReady(MSContext context) { try { context.Database.EnsureCreated(); context.Database.Migrate(); } catch (Exception ex) { context.Database.EnsureDeleted(); context.Database.Migrate(); } }
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(); }
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; }
public ClienteRepository(MSContext ctx) : base(ctx) { this.ctx = ctx; }
public BaseRepository(MSContext context, DbSet <TEntity> dataSet) { Db = context; DbSet = dataSet; }
public MobileRepository(MSContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public GetMerchantQueryHandler(MSContext context) { _context = context; }
public DeleteMerchantCommandHandler(MSContext context) { _context = context; }
public PostMerchantCommandHandler(MSContext context) { _context = context; }
public AccountService(UserManager <User> userManager, MSContext context) { _userManager = userManager; _db = context; }
public UserService(MSContext context) { _context = context; }
public RatingService(MSContext context) { _db = context; }
public PriceListService(MSContext db) { _db = db; }
public BaseRepository(MSContext context) { this.context = context; entity_ = context.Set <T>(); }
public SeguidorRepository(MSContext context) : base(context) { }
public ClientsController(MSContext context) { _context = context; }
public GameService(MSContext context) { _context = context; }
public TestService(MSContext context) { _context = context; }
public AnswerService(MSContext context) { _context = context; }
public UnitOfWork(MSContext context) { _dbContext = context; }