Exemple #1
0
        private static async Task SeedPermissionAsync(ApplicationDbContext context)
        {
            var data     = InitializeData.BuildPermissionsList();
            var dbData   = context.Permissions.ToList();
            var diffData = data.Where(c => dbData.All(e => e.Label != c.Label)).ToList();
            await context.Permissions.AddRangeAsync(diffData).ConfigureAwait(false);

            await context.SaveChangesAsync().ConfigureAwait(false);
        }