public CreateRegionCommand( IUserAuthorizationService userAuthorizationService, CoreDbContext coreDbContext, RegionMapper regionMapper) { _userAuthorizationService = userAuthorizationService; _coreDbContext = coreDbContext; _regionMapper = regionMapper; }
public CoreDbContext GetCoreDbContext() { var options = new DbContextOptionsBuilder <CoreDbContext>() .UseInMemoryDatabase(databaseName: "InMemoryRestaurantDatabase") .Options; var dbContext = new CoreDbContext(options); return(dbContext); }
public DeleteRegionMembershipCommand( IUserAuthorizationService authorizationService, CoreDbContext coreDbContext, IRegionCache regionCache) { _authorizationService = authorizationService; _coreDbContext = coreDbContext; _regionCache = regionCache; }
public MyMagics( CoreDbContext context, UserSecurityContext permissionManager, UserContext userContext) { this.context = context; this.permissionManager = permissionManager; this.userContext = userContext; }
public ProductMigrationService(IProductMongoRepository productRepository, CoreDbContext dbContext) { _productRepository = productRepository; _dbContext = dbContext; _sqlProductDbSet = _dbContext.Set <Product>(); _sqlProductSPPPropertiesDbSet = _dbContext.Set <ProductSPPProperty>(); _sqlUomDbSet = _dbContext.Set <Uom>(); _sqlCurrencyDbSet = _dbContext.Set <Currency>(); }
private static async Task AddInternalAsync(CoreDbContext context, IEntity entity) { if (entity is IDerivedEntity derived) { await AddInternalAsync(context, derived._BaseClone); } await context.AddAsync(entity); }
internal override void OnLoadingXml(Application app, CoreDbContext ctx) { if ((Button?.Length ?? 0) > 0) { Array.Sort(Button); } base.OnLoadingXml(app, ctx); }
public void Handle(RelationShipToRemoved e) { using (var db = new CoreDbContext()) { var temp = db.RelationShips.Where(i => i.ToId == e.ToId).ToList(); db.RelationShips.RemoveRange(temp); db.SaveChanges(); } }
private static void AddInternal(CoreDbContext context, IEntity entity) { if (entity is IDerivedEntity derived) { AddInternal(context, derived._BaseClone); } context.Add(entity); }
internal override void OnLoadingXml(Application app, CoreDbContext ctx) { base.OnLoadingXml(app, ctx); if (string.IsNullOrWhiteSpace(MenuName)) { MenuName = Name; } }
public QueryRegionRoleCommand( IUserAuthorizationService authorizationService, CoreDbContext coreDbContext, IMapper mapper) { _authorizationService = authorizationService; _coreDbContext = coreDbContext; _mapper = mapper; }
public HomeController(IRepository <Warehouse> repoWarehouse, IRepository <Product> repoProduct, IRepository <Customer> repoCustomer, IRepository <Orders> repoOrders, CoreDbContext dbContext) { this.repoCustomer = repoCustomer; this.repoProduct = repoProduct; this.repoWarehouse = repoWarehouse; this.repoOrders = repoOrders; this.dbContext = dbContext; }
internal override void OnLoadingUserModel(Application app, CoreDbContext ctx) { if ((SubViews?.DetailViews?.Length ?? 0) > 0) { EditModal = Array.Find(SubViews.DetailViews, x => x.Id == EditModalId); } base.OnLoadingUserModel(app, ctx); }
public static void Update_Auditable(this CoreDbContext context, IEntity entity) { if (context.Entry(entity).State == EntityState.Detached) { context.Entry(entity).State = EntityState.Unchanged; } UpdateEntityFields(entity, context.UserInfo); UpdateInternal(context, entity); }
public AppUserContextAccessor( SignInManager <ApplicationUser> signInManager, CookieManager cookieManager, UserRoleCheckerRegister register, CoreDbContext context) : base(register) { this.signInManager = signInManager; this.cookieManager = cookieManager; this.context = context; }
public MagicConversationManager(CoreDbContext context, UserContext userContext, UserManager <ApplicationUser> userManager, MagicPermissionManager permissionManager) { this.context = context; this.userContext = userContext; this.userManager = userManager; this.permissionManager = permissionManager; }
public CloseMagic(CoreDbContext context, EmailTemplateRegister emailSender, NotificationsDbContext notificationsDbContext, IOptions <AppConfig> appConfig) { this.context = context; this.emailSender = emailSender; this.notificationsDbContext = notificationsDbContext; this.appConfig = appConfig; }
public static async Task <Inbox> EnsureInbox(this CoreDbContext context, string email, params RegisteredUser[] users) { var inbox = new Inbox(email, email, users); context.Inboxes.Add(inbox); await context.SaveChangesAsync(); return(inbox); }
public static DbContextOptions Setup(DbContextOptions options) { var doc = XDocument.Load(Path.Combine( Path.GetDirectoryName(typeof(CustomerDataTests).GetTypeInfo().Assembly.Location), "TestData", "TestData.xml")); var import = new XmlImport(doc, "http://tempuri.org/Database.xsd"); var customer = new List <Customer>(); using (var session = new CoreDbContext(options)) { import.Parse(new[] { typeof(Customer), typeof(Order), typeof(Product) }, (type, obj) => { switch (type.Name) { case nameof(Customer): session.Customers.Add((Customer)obj); break; case nameof(Order): session.Orders.Add((Order)obj); break; case nameof(Product): session.Products.Add((Product)obj); break; default: break; } }); session.SaveChanges(); } using (var session = new CoreDbContext(options)) { import.ParseConnections("OrderProduct", "Product", "Order", (productId, orderId) => { var product = session.GetProduct(productId); var order = session.GetOrder(orderId); session.ProductOrders.Add(new ProductOrder { Order = order, Product = product }); }); import.ParseIntProperty("Order", "Customer", (orderId, customerId) => { var order = session.GetOrder(orderId); order.Customer = session.GetCustomer(customerId); }); session.SaveChanges(); } return(options); }
public PermissionService(CoreDbContext context) { _context = context; _validRoles = new HashSet <string> { "therapist", "nurse", "admin", "physician" }; }
public static void SeedHostDb(CoreDbContext context) { context.SuppressAutoSetTenantId = true; // Host seed new InitialHostDbBuilder(context).Create(); // Default tenant seed (in host database). new DefaultTenantBuilder(context).Create(); new TenantRoleAndUserBuilder(context, 1).Create(); }
public QueryEventsCommand( IUserAuthorizationService userAuthorizationService, CoreDbContext dbContext, IRegionCache regionCache, EventMapper eventMapper) { _userAuthorizationService = userAuthorizationService; _dbContext = dbContext; _regionCache = regionCache; _eventMapper = eventMapper; }
public AppUserContextAccessor( UserRoleCheckerRegister roleCheckerRegister, UserManager <ApplicationUser> userManager, CoreDbContext dbContext, UserSession userSession) : base(roleCheckerRegister) { this.userManager = userManager; this.dbContext = dbContext; this.userSession = userSession; }
// GET: Admin/AdminRole public ActionResult Index() { var model = new RoleListAdminPage(); using (var db = new CoreDbContext()) { model.Roles = db.Roles.OrderBy(i => i.Title).ToList(); model.Rights = db.Rights.OrderBy(i => i.KeyName).ThenBy(i => i.Title).ToList(); } return(View(model)); }
public BackendUnitOfWork(CoreDbContext context, IEnumerable <IInterceptor> interceptors) : base(context, interceptors) { DataItem = new BaseRepository <DataItemEntity>(context); DataItemDetail = new BaseRepository <DataItemDetailEntity>(context); Area = new BaseRepository <AreaEntity>(context); Module = new BaseRepository <ModuleEntity>(context); Permission = new BaseRepository <PermissionEntity>(context); Organize = new BaseRepository <OrganizeEntity>(context); Department = new BaseRepository <DepartmentEntity>(context); DMOS = new BaseRepository <DMOSEntity>(context); }
public CreateEventsCommand( IUserAuthorizationService authorizationService, CoreDbContext coreDbContext, IRegionCache regionCache, EventMapper mapper) { _authorizationService = authorizationService; _coreDbContext = coreDbContext; _regionCache = regionCache; _mapper = mapper; }
private static async Task InitSubjectDataAsync(CoreDbContext dbContext) { var subjectsCount = await dbContext.Subjects.CountAsync(); if (subjectsCount == 0) { await dbContext.Subjects.AddRangeAsync(InitData.Subjects); await dbContext.SaveChangesAsync(); } }
public Lib.Models.Unit GetTestData(CoreDbContext dbContext) { Lib.Models.Unit data = new Lib.Models.Unit() { Code = "" }; dbContext.Units.Add(data); dbContext.SaveChanges(); return(data); }
private bool ExistedSeoUrlFiendly(string seoUrlFiendly, Guid id) { using (var db = new CoreDbContext()) { var existedSeoUrl = db.ContentLanguages.Any(i => i.Id != id && i.ColumnValue.Equals(seoUrlFiendly, StringComparison.OrdinalIgnoreCase)); return(existedSeoUrl); } }
public Activities( SystemPermissionManager permissionManager, UserContext userContext, CoreDbContext dbContext, ActivityPermissionManager activityPermissionManager) { this.permissionManager = permissionManager; this.userContext = userContext; this.dbContext = dbContext; this.activityPermissionManager = activityPermissionManager; }
public TestController(CoreDbContext dbContext) { DbContext = dbContext; }
public CoreDbContext Init() { return dbContext ?? (dbContext = new CoreDbContext()); }
public OwnerController(CoreDbContext data) { Data = data; }
public TestController(CoreDbContext data) { _data = data; }