Entity Framework Plus extends your DbContext with must-haves features: Include Filter, Auditing, Caching, Query Future, Batch Delete, Batch Update, and more
MIT License
Bot releases are visible (Hide)
Published by JonathanMagnan about 7 years ago
QueryFilterManager.AllowPropertyFilter = true
now allow to filter single (non-collection) property.QueryFilterManager.AllowPropertyFilter = true;
using (var ctx = new EntityContext())
{
ctx.Filter<Invoice>(q => q.Where(x => !x.IsDeleted));
ctx.Filter<InvoiceItem>(q => q.Where(x => !x.IsDeleted));
var list = ctx.InvoiceItems.Where(x => x.Invoice.Total > 400).Include("Invoice").ToList();
}
Published by JonathanMagnan about 7 years ago
Published by JonathanMagnan about 7 years ago
Published by JonathanMagnan about 7 years ago
Published by JonathanMagnan about 7 years ago
UseTableLock
optionUseTableLock
optionAllowQueryBatch
optionQueryFutureManager.AllowQueryBatch = false;
ctx.Activities.Where(a => a.DateCreated < d).Delete(delete => delete.UseTableLock = false );
Published by JonathanMagnan about 7 years ago
Published by JonathanMagnan about 7 years ago
Thank you @Immelstorn for your contribution with the pull #189
Published by JonathanMagnan over 7 years ago
When this option is enabled, all information from command become optional (Connection && CommandText). They are only included if there are found. It allows caching any kind of list even when not coming from Entity Framework.
var listA = new List<CustomEntity>() { new CustomEntity() { X = 1 }, new CustomEntity() { X = 2 }, new CustomEntity() { X = 3 }};
var listB = new List<CustomEntity>() { new CustomEntity() { X = 4 }, new CustomEntity() { X = 5 }, new CustomEntity() { X = 6 } };
QueryCacheManager.IsCommandInfoOptionalForCacheKey = true;
QueryCacheManager.UseTagsAsCacheKey = true;
var t1 = listA.AsQueryable().FromCache("a");
var t2 = listB.AsQueryable().FromCache("a");