public void Members_check_arguments() { var finder = new DbSetFinder(); Assert.Equal( "context", // ReSharper disable once AssignNullToNotNullAttribute Assert.Throws <ArgumentNullException>(() => finder.FindSets(null)).ParamName); }
private IModel CreateModel(DbContext context, IModelBuilderFactory modelBuilderFactory) { var model = new Model(); var modelBuilder = modelBuilderFactory.CreateConventionBuilder(model); foreach (var setInfo in _setFinder.FindSets(context)) { modelBuilder.Entity(setInfo.EntityType); } ModelSourceHelpers.OnModelCreating(context, modelBuilder); model["AllYourModelAreBelongTo"] = "Us!"; return(model); }
public IModel GetModel(DbContext context, IModelBuilderFactory modelBuilderFactory) { var model = new Model(); var modelBuilder = modelBuilderFactory.CreateConventionBuilder(model); foreach (var setInfo in _setFinder.FindSets(context)) { modelBuilder.Entity(setInfo.EntityType); } if (_onModelCreating == null) { ModelSourceHelpers.OnModelCreating(context, modelBuilder); } else { _onModelCreating(modelBuilder); } return(model); }