|
@@ -76,17 +76,17 @@ namespace Luticate2.Utils.DataAccess
|
76
|
76
|
return id;
|
77
|
77
|
}
|
78
|
78
|
|
79
|
|
- protected virtual IQueryable<TModel> GetGetQueryable(TDbContext db, DbSet<TModel> table)
|
|
79
|
+ protected virtual IQueryable<TModel> GetGetQueryable(TDbContext db, IQueryable<TModel> table)
|
80
|
80
|
{
|
81
|
81
|
return table;
|
82
|
82
|
}
|
83
|
83
|
|
84
|
|
- protected virtual IQueryable<TModel> GetEditQueryable(TDbContext db, DbSet<TModel> table)
|
|
84
|
+ protected virtual IQueryable<TModel> GetEditQueryable(TDbContext db, IQueryable<TModel> table)
|
85
|
85
|
{
|
86
|
86
|
return table;
|
87
|
87
|
}
|
88
|
88
|
|
89
|
|
- protected virtual IQueryable<TModel> GetDeleteQueryable(TDbContext db, DbSet<TModel> table)
|
|
89
|
+ protected virtual IQueryable<TModel> GetDeleteQueryable(TDbContext db, IQueryable<TModel> table)
|
90
|
90
|
{
|
91
|
91
|
return table;
|
92
|
92
|
}
|
|
@@ -107,14 +107,14 @@ namespace Luticate2.Utils.DataAccess
|
107
|
107
|
return LuResult<T>.Error(LuStatus.NotFound, typeof(TModel).Name + ": Value not found", "");
|
108
|
108
|
}
|
109
|
109
|
|
110
|
|
- protected virtual IQueryable<TModel> GetFilterQuery(LuFilterDbo filter, TDbContext db, DbSet<TModel> table)
|
|
110
|
+ protected virtual IQueryable<TModel> GetFilterQuery(LuFilterDbo filter, TDbContext db, IQueryable<TModel> table)
|
111
|
111
|
{
|
112
|
112
|
return GetGetQueryable(db, table).Where(GetFilterExpression(filter));
|
113
|
113
|
}
|
114
|
114
|
|
115
|
115
|
|
116
|
116
|
|
117
|
|
- protected virtual LuResult<bool> _Add(TModel model, TDboCreate dbo, TDbContext db, DbSet<TModel> table)
|
|
117
|
+ protected virtual LuResult<bool> _Add(TModel model, TDboCreate dbo, TDbContext db, IQueryable<TModel> table)
|
118
|
118
|
{
|
119
|
119
|
return LuResult<bool>.Ok(true);
|
120
|
120
|
}
|
|
@@ -268,7 +268,7 @@ namespace Luticate2.Utils.DataAccess
|
268
|
268
|
return GetMultiple(orderBy, x => true, page, perPage, otherOrderBy);
|
269
|
269
|
}
|
270
|
270
|
|
271
|
|
- public virtual LuResult<LuPaginatedDbo<TDboRead>> GetMultiple(LuOrderByDbo orderBy, Func<TDbContext, DbSet<TModel>, IQueryable<TModel>> getQueryable,
|
|
271
|
+ public virtual LuResult<LuPaginatedDbo<TDboRead>> GetMultiple(LuOrderByDbo orderBy, Func<TDbContext, IQueryable<TModel>, IQueryable<TModel>> getQueryable,
|
272
|
272
|
int page = 0, int perPage = int.MaxValue)
|
273
|
273
|
{
|
274
|
274
|
return Execute((db, table) =>
|
|
@@ -384,7 +384,7 @@ namespace Luticate2.Utils.DataAccess
|
384
|
384
|
}
|
385
|
385
|
}
|
386
|
386
|
|
387
|
|
- protected virtual LuResult<bool> _EditSingleById(TModel model, TDboUpdate update, TDbContext db, DbSet<TModel> table)
|
|
387
|
+ protected virtual LuResult<bool> _EditSingleById(TModel model, TDboUpdate update, TDbContext db, IQueryable<TModel> table)
|
388
|
388
|
{
|
389
|
389
|
return LuResult<bool>.Ok(true);
|
390
|
390
|
}
|