public async Task SeedRoles()
        {
            if (!_context.Roles.Any())
            {
                var roles = new List <Role>
                {
                    new Role
                    {
                        Name = "Maid"
                    },
                    new Role
                    {
                        Name = "Technician",
                        CanPublishDefects = true
                    },
                };

                await _context.Roles.AddRangeAsync(roles);

                await _context.SaveChangesAsync();
            }
        }
Ejemplo n.º 2
0
 protected async Task SaveChangesAsync()
 {
     await _context.SaveChangesAsync();
 }