public ReadableRepository( CommandDbContext dbContext, ISpecificationEvaluationService <TEntity> specificationEvaluationService) { _dbContext = dbContext; _specificationEvaluationService = specificationEvaluationService; }
//private readonly RoleManager<SilverlineRole> _roleManager; public UsersController(UserManager <SilverlineUser> userManager, SignInManager <SilverlineUser> signInManager, CommandDbContext dbContext) { _userManager = userManager; _signInManager = signInManager; _dbContext = dbContext; }
public AccountController(CommandDbContext dbContext, SignInManager <SilverlineUser> signInManager, UserManager <SilverlineUser> userManager) { _userManager = userManager; _signInManager = signInManager; _dbContext = dbContext; }
private void commandNameSearchTb_TextChanged(object sender, EventArgs e) { var keyword = commandNameSearchTb.Text.Trim(); using (CommandDbContext db = new CommandDbContext()) { dataGridView1.DataSource = db.Commands.Where(s => s.commandName.StartsWith(keyword)).ToList(); } }
public UnitOfWork( CommandDbContext context, IArticleRepository articleRepository, IUserRepository userRepository) { _context = context; ArticleRepository = articleRepository; UserRepository = userRepository; }
public void Register(RegisterInputModel input) { // Push a command through the stack using (var db = new CommandDbContext()) { var match = new Match { Id = input.Id, Team1 = input.Team1, Team2 = input.Team2 }; db.Matches.Add(match); db.SaveChanges(); } }
public DataUnitOfWork( CommandDbContext commandDbContext, IMutatableRepository <User> users, IMutatableRepository <Token> tokens, IMutatableRepository <Room> rooms, IMutatableRepository <Message> messages) { _commandDbContext = commandDbContext; Users = users; Tokens = tokens; Rooms = rooms; Messages = messages; }
public void AgregarProducto(ProductoInputModel productoModel) { using (var db = new CommandDbContext()) { db.Productos.Add(new Command.Producto { Nombre = productoModel.Nombre, CategoriaNombre = productoModel.Categoria, TipoNombre = productoModel.Tipo }); db.SaveChanges(); } }
private void Form1_Load(object sender, EventArgs e) { //foreach (var items in Properties.Settings.Default.COMMANDS) //{ // var item = items.Split(','); // //, new Command("cmd", "cmd", "コマンドプロンプト", "コマンドプロンプト", 0, DateTime.Now, DateTime.Now) // Console.WriteLine(@",new Command(""" + item[0] + @""",""" + item[3] + @""",""" + item[1] + @""",""" + item[2] // + @""",0, DateTime.Now, DateTime.Now)"); //} //フォーム表示設定 this.Height = 150; this.Width = 400; this.KeyPreview = true; this.FormBorderStyle = FormBorderStyle.FixedDialog; this.MinimizeBox = false; this.MaximizeBox = false; //フォーム表示位置 switch (Properties.Settings.Default.displaySetting) { case "左上": this.Top = 0; this.Left = 0; break; case "左下": this.Top = Screen.PrimaryScreen.Bounds.Height - this.Height - 35; this.Left = 0; break; default: break; } //コマンド一覧表示 List <Command> commandList; using (CommandDbContext db = new CommandDbContext()) { commandList = db.Commands.ToList(); } dataGridView1.DataSource = commandList; //コンボボックス サジェスト設定 mainCb.Focus(); AutoCompleteStringCollection sAutoList = new AutoCompleteStringCollection(); mainCb.AutoCompleteMode = AutoCompleteMode.SuggestAppend; mainCb.AutoCompleteSource = AutoCompleteSource.CustomSource; mainCb.AutoCompleteCustomSource = sAutoList; //コンボボックス サジェストコマンド登録 commandList.ToList().ForEach(c => sAutoList.Add(c.alias)); }
private void mainCb_KeyUp(object sender, KeyEventArgs e) { using (CommandDbContext db = new CommandDbContext()) { try { Command command = db.Commands.FirstOrDefault(c => c.alias == mainCb.Text.Trim()); if (command != null) { statusLb.Text = command.command + Environment.NewLine + command.commandName; } } catch (Exception) { } } }
public DatabaseFixture() { _connection = new SqliteConnection("datasource=:memory:"); _connection.Open(); _options = new DbContextOptionsBuilder <CommandDbContext>() .UseSqlite(_connection) .Options; TestContext = new CommandDbContext(_options); TestContext.Database.EnsureCreated(); TestContext.Articles.AddRange(ArticleList.GetDefaultList()); TestContext.SaveChanges(); _readOnlyOptions = new DbContextOptionsBuilder <QueryDbContext>() .UseSqlite(_connection) .Options; TestReadOnlyContext = new QueryDbContext(_readOnlyOptions); TestReadOnlyContext.Database.EnsureCreated(); }
public static async Task SeedArticles(CommandDbContext context) { if (await context.Articles.AnyAsync()) return; var articleData = await System.IO.File.ReadAllTextAsync(AppDomain.CurrentDomain.BaseDirectory + "/_SeedData/ArticleSeedData.json"); var articlePhotoData = await System.IO.File.ReadAllTextAsync(AppDomain.CurrentDomain.BaseDirectory + "/_SeedData/ArticlePhotoSeedData.json"); var articles = JsonSerializer.Deserialize<List<Article>>(articleData); var articlePhotos = JsonSerializer.Deserialize<List<ArticlePhoto>>(articlePhotoData); foreach (var article in articles) { context.Articles.Add(article); } await context.SaveChangesAsync(); foreach (var articlePhoto in articlePhotos) { context.ArticlePhotos.Add(articlePhoto); } await context.SaveChangesAsync(); }
public SalesPersonController(CommandDbContext dbContext) { _dbContext = dbContext; // _configuration = configuration; }
public PurchaseOrderController(IServiceProvider serviceProvider, CommandDbContext dbContext) : base(serviceProvider) { _dbContext = dbContext; }
public DataSeedingService(CommandDbContext context) { _context = context; }
public ReasonController(CommandDbContext dbContext) { _dbContext = dbContext; }
public AdminApplicationService(Database database, CommandDbContext commandDbContext) { _database = database; _commandDbContext = commandDbContext; }
public WareHouseController(CommandDbContext dbContext) { _dbContext = dbContext; // _configuration = configuration; }
/// <summary> /// コマンド入力 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void comboBoxMain_KeyDown(object sender, KeyEventArgs e) { //ENTER押下 if (e.KeyValue == (char)Keys.Enter) { Command currentCommand; using (CommandDbContext db = new CommandDbContext()) { currentCommand = db.Commands.Single(c => c.alias == mainCb.Text.Trim()); } string command = currentCommand.command; string currentArg = ""; //スペースがあるコマンドの場合 if (command.Contains(" ")) { //shell:で始まるもの if (!command.Contains("shell:")) { currentArg = command.Substring(command.IndexOf(" "), command.Length - command.IndexOf(" ")).Trim(); command = command.Substring(0, command.IndexOf(" ")).Trim(); } } Process p = new Process(); p.StartInfo.FileName = command; // コマンド名 if (currentArg != "") { p.StartInfo.Arguments = currentArg; } // 引数有の場合 if (e.Shift && e.Control) { p.StartInfo.Verb = "RunAs"; } // CTRL + Shiftが押されたら管理者権限実行 //p.StartInfo.CreateNoWindow = true; // DOSプロンプトの黒い画面を非表示 //p.StartInfo.UseShellExecute = false; // プロセスを新しいウィンドウで起動するか否か //p.StartInfo.RedirectStandardOutput = true; // 標準出力をリダイレクトして取得したい try { p.Start(); //アイドル状態になるまで待機 //p.WaitForInputIdle(); //表示サイズ //if (e.Alt) //{ // MoveWindow(p.MainWindowHandle, 0, 0, // Screen.PrimaryScreen.Bounds.Width / 2, // Screen.PrimaryScreen.Bounds.Height, // 1); //} //「常に起動」にチェックなしの場合 if (!checkBoxKidoSetting.Checked) { this.Close(); this.Dispose(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
public HomeController(ILogger <HomeController> logger, CommandDbContext dbContext, IServiceProvider serviceProvider) : base(serviceProvider) { _dbContext = dbContext; _logger = logger; }
public ArticleRepository(CommandDbContext context) : base(context) { }
public SomethingRepository(CommandDbContext dbContext) { _dbContext = dbContext; }
public VendorController(CommandDbContext dbContext) { _dbContext = dbContext; }
public DepartmentController(CommandDbContext dbContext) { _dbContext = dbContext; }
public BaseEfMutatableRepository(CommandDbContext dbContext) : base(dbContext) { _commandDbContext = dbContext; }
public MutatableRepository( CommandDbContext dbContext, ISpecificationEvaluationService <TEntity> specificationEvaluationService) : base(dbContext, specificationEvaluationService) { }
public RepositoryBase(CommandDbContext context) { Context = context; }
public PODataController(CommandDbContext dbContext) { _dbContext = dbContext; //DbConnection = "Data Source=sql5050.site4now.net;User ID=DB_A6EA60_Raksha2710_admin;Password=Mazda@123;"; DbConnection = "Data Source=b2bpotential.cnb1fgovpd8k.ap-south-1.rds.amazonaws.com; Database=SLPurchaseOrderDB; User ID=admin; Password=STELLANS$sd*1;"; }
public UserRepository(CommandDbContext context) : base(context) { }
public CommandRepository(CommandDbContext context) { _context = context; }