This commit is contained in:
Collin M. Barrett 2018-09-28 10:15:13 -05:00
parent 5bfe4ed976
commit c03ec0f8b7

View file

@ -151,15 +151,15 @@ private static string GetUpdateUnchangedColumnHack(IEnumerable<IProperty> proper
private static void SetDefaultLicenseId(this DbContext dbContext)
{
var lists = dbContext.Set<FilterList>()
.Where(l => l.LicenseId == null)
.ToList()
.Select(c =>
{
c.LicenseId = 5;
return c;
});
dbContext.UpdateRange(lists);
var listsWithoutLicense = dbContext.Set<FilterList>()
.Where(l => l.LicenseId == null)
.ToList()
.Select(l =>
{
l.LicenseId = 5;
return l;
});
dbContext.UpdateRange(listsWithoutLicense);
dbContext.SaveChanges();
}
}