Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 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 _));
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
 public static IQueryable <TModel> Query <TModel>(this StandardDataSource <TModel, TestDbContext> source)
     where TModel : class, new()
 {
     return(source.Db.Set <TModel>());
 }
Ejemplo n.º 6
0
 public StandardDataSourceTests() : base()
 {
     CaseSource = Source <Case>();
 }