public static IQueryable <TModel> Query <TModel>( this StandardDataSource <TModel, TestDbContext> source, Func <StandardDataSource <TModel, TestDbContext>, IQueryable <TModel> > method ) where TModel : class, new() { return(method(source)); }
public static StandardDataSource <TModel, TestDbContext> AddModel <TModel, TProp>( this StandardDataSource <TModel, TestDbContext> source, Expression <Func <TModel, TProp> > propSelector, TProp propValue ) where TModel : class, new() { return(source.AddModel(propSelector, propValue, out _)); }
public static StandardDataSource <TModel, TestDbContext> AddModel <TModel>( this StandardDataSource <TModel, TestDbContext> source, TModel model ) where TModel : class, new() { source.Db.Set <TModel>().Add(model); source.Db.SaveChanges(); return(source); }
public static StandardDataSource <TModel, TestDbContext> AddModel <TModel, TProp>( this StandardDataSource <TModel, TestDbContext> source, Expression <Func <TModel, TProp> > propSelector, TProp propValue, out PropertyViewModel propInfo ) where TModel : class, new() { var model = new TModel(); propInfo = source.ClassViewModel.PropertyBySelector(propSelector); propInfo.PropertyInfo.SetValue(model, propValue); return(source.AddModel(model)); }
public static IQueryable <TModel> Query <TModel>(this StandardDataSource <TModel, TestDbContext> source) where TModel : class, new() { return(source.Db.Set <TModel>()); }
public StandardDataSourceTests() : base() { CaseSource = Source <Case>(); }