public void Does_not_throw_when_non_virtual_indexer_not_mapped() { using var context = new ChangeContext <ChangeNonVirtualIndexerNotUsed>(); Assert.DoesNotContain( context.Model.FindEntityType(typeof(ChangeNonVirtualIndexerNotUsed)).GetProperties(), e => e.IsIndexerProperty()); }
public void Sets_default_change_tracking_strategy() { using var context = new ChangeContext <ChangeValueEntity>(); Assert.Equal( ChangeTrackingStrategy.ChangingAndChangedNotifications, context.Model.GetChangeTrackingStrategy()); }
public void Throws_if_non_virtual_indexer_property() { using var context = new ChangeContext <ChangeNonVirtualIndexer>(entityBuilderAction: b => b.IndexerProperty <int>("Snoopy")); Assert.Equal( ProxiesStrings.NonVirtualIndexerProperty(nameof(ChangeNonVirtualIndexer)), Assert.Throws <InvalidOperationException>(() => context.Model).Message); }
public void Raises_changing_event_before_change(bool useLazyLoading) { using var context = new ChangeContext <ChangeValueEntity>(useLazyLoading: useLazyLoading); var proxy = context.CreateProxy <ChangeValueEntity>(); proxy.Value = 5; context.Add(proxy); context.SaveChanges(); var eventRaised = false; ((INotifyPropertyChanging)proxy).PropertyChanging += (s, e) => { eventRaised = true; Assert.Equal(proxy, s); Assert.Equal( nameof(ChangeValueEntity.Value), e.PropertyName); Assert.Equal( 5, ((ChangeValueEntity)s).Value); }; proxy.Value = 10; Assert.True(eventRaised); }
public ChangeEventArgs(ChangeType type, ChangeContext context, int index, object additionalInfo = null) { Change = type; Context = context; Index = index; AdditionalInformation = additionalInfo; }
public void Throws_if_non_virtual_navigation() { using var context = new ChangeContext <ChangeNonVirtualNavEntity>(); Assert.Equal( ProxiesStrings.NonVirtualProperty(nameof(ChangeNonVirtualNavEntity.SelfRef), nameof(ChangeNonVirtualNavEntity)), Assert.Throws <InvalidOperationException>( () => context.Model).Message); }
public void Throws_if_sealed_class() { using var context = new ChangeContext <ChangeSealedEntity>(); Assert.Equal( ProxiesStrings.ItsASeal(nameof(ChangeSealedEntity)), Assert.Throws <InvalidOperationException>( () => context.Model).Message); }
public void Default_change_tracking_strategy_doesnt_overwrite_entity_strategy() { using var context = new ChangeContext <ChangeValueEntity>( entityBuilderAction: b => { b.HasChangeTrackingStrategy(ChangeTrackingStrategy.Snapshot); }); var entityType = context.Model.FindEntityType(typeof(ChangeValueEntity)); Assert.Equal( ChangeTrackingStrategy.Snapshot, entityType.GetChangeTrackingStrategy()); }
public void Raises_changing_event_when_equal_and_check_equality_false(bool useLazyLoading) { using var context = new ChangeContext <ChangeValueEntity>(useLazyLoading: useLazyLoading, checkEquality: false); var proxy = context.CreateProxy <ChangeValueEntity>(); proxy.Value = 10; context.Add(proxy); context.SaveChanges(); var eventRaised = false; ((INotifyPropertyChanging)proxy).PropertyChanging += (s, e) => { eventRaised = true; }; proxy.Value = 10; Assert.True(eventRaised); }
public UsersController(ChangeContext context, ILogger <UsersController> logger) { _context = context; _logger = logger; }
public UserService(ChangeContext context) { _context = context; }
public NewsController(ChangeContext context, ILogger <NewsController> logger) { _context = context; _logger = logger; }
public OrdersDetailsController(ChangeContext context) { _context = context; }
public CategoriesController(ChangeContext context) { _context = context; }
/// <summary> /// Override this method to be notified when the UI detects a change. /// </summary> /// <param name="context">Context object allowing to retrieve information about the change.</param> protected internal virtual void OnContentChanged(ChangeContext context) { }
public void Change(ChangeType type, ChangeContext context, int index, object additionalInfo = null) { OnChange?.Invoke(this, new ChangeEventArgs(type, context, index, additionalInfo)); }
public ChangeService(ChangeContext context) { _context = context; }
public AppraisesController(ChangeContext context) { _context = context; }
public ContextChanger(ChangeContext changeContext, ProvideContextSource provideContextSource) { _changeContext = changeContext; ContextSource = provideContextSource; }
public CarsController(ChangeContext context) { _context = context; }
public HomeController(ILogger <HomeController> logger, ChangeContext context, IWebHostEnvironment hostingEnvironment) { _logger = logger; _context = context; _hostingEnvironment = hostingEnvironment; }
public DeliveriesController(ChangeContext context) { _context = context; }
static Config() { PublishCtx = createPublishDomainContext(); ChangeCtx = createChangeContext(); }
public ChangeController(ChangeContext context, Change changeService, IConfiguration configuration) { _context = context; _changeService = changeService; _config = configuration; }
public ProductsController(ChangeContext context, ILogger <ProductsController> logger) { _context = context; //数据库上下文 _logger = logger; //日志 }
public PhotosController(ChangeContext context) { _context = context; }
public FavoritesController(ChangeContext context) { _context = context; }
public LoginController(ChangeContext context, ILogger <LoginController> logger) { _context = context; _logger = logger; }