Beispiel #1
0
 public PermissionAddedToRoleEventHandler(IHubContext <GroupsHub, IGroupsHubContract> contract, GroupsContext groupsContext)
 {
     _contract      = contract;
     _groupsContext = groupsContext;
 }
 public GetGroupChannelHandler(GroupsContext context)
 {
     _context = context;
 }
    static void Main(string[] args)
    {
        using (var context = new GroupsContext())
        {
            context.Database.EnsureDeleted();
            context.Database.EnsureCreated();

            var maurycy = new User {
                Name = "Maurycy"
            };
            var arthur = new User {
                Name = "Arthur"
            };
            var andriy = new User {
                Name = "Andriy"
            };
            var brice = new User {
                Name = "Brice"
            };
            var smit = new User {
                Name = "Smit"
            };
            var shay = new User {
                Name = "Shay"
            };
            var jeremy = new User {
                Name = "Jeremy"
            };

            var efTeam = new Group {
                Name = "EF Team"
            };
            var queryTeam = new Group {
                Name = "Query Team"
            };
            var managers = new Group {
                Name = "Managers"
            };
            var engineers = new Group {
                Name = "Engineers"
            };

            efTeam.Users.AddRange(new[] { maurycy, arthur, andriy, brice, smit, shay, jeremy });
            queryTeam.Users.AddRange(new[] { maurycy, smit });
            managers.Users.AddRange(new[] { arthur, jeremy });
            engineers.Users.AddRange(new[] { maurycy, andriy, brice, smit, shay });

            context.AddRange(maurycy, arthur, andriy, brice, smit, shay, jeremy, efTeam, queryTeam, managers, engineers);

            context.SaveChanges();
        }

        using (var context = new GroupsContext())
        {
            var users = context.Users.Include(e => e.Groups).ToList();

            Console.WriteLine();
            Console.WriteLine("ON.NET SHOW: EF Core 5.x Tour Many To Many Part 2");
            Console.WriteLine();
            Console.WriteLine("Users with Groups");
            Console.WriteLine();

            foreach (var user in users)
            {
                Console.WriteLine($"User: {user.Name}");
                foreach (var group in user.Groups)
                {
                    Console.WriteLine($"  Group: {group.Name}");
                }
            }
        }
    }
 public GetMessagesQueryHandler(GroupsContext groupsContext)
 {
     _groupsContext = groupsContext;
 }
Beispiel #5
0
 public GroupRepository(GroupsContext context)
 {
     _context = context;
 }
 protected BaseRepository(GroupsContext context)
 {
     Context = context;
 }
Beispiel #7
0
 public GetMemberRolesQueryHandler(GroupsContext context)
 {
     _context = context;
 }
Beispiel #8
0
 public GroupRepositoryTests()
 {
     _context = new GroupsContext(); //need to mock but i don`t understand how
 }
 public GetRolePermissionsHandler(GroupsContext context)
 {
     _context = context;
 }
 public ChannelRepository(GroupsContext context)
 {
     _context = context;
 }
 public InvitationRevokedEventHandler(IHubContext <GroupsHub, IGroupsHubContract> hubContext, GroupsContext groupsContext)
 {
     _hubContext    = hubContext;
     _groupsContext = groupsContext;
 }
 public MessageRepository(GroupsContext context)
 {
     _context = context;
 }
Beispiel #13
0
 public GetChannelRolePermissionOverridesHandler(GroupsContext context)
 {
     _context = context;
 }
 public GroupsController(GroupsContext context)
 {
     _context = context;
 }
Beispiel #15
0
 public GetRoleQueryHandler(GroupsContext context) => _context = context;
Beispiel #16
0
 public UniqueInvitationCodeRule(GroupsContext context)
 {
     _context = context;
 }
 public PermissionRemovedFromRoleEventHandler(IHubContext <GroupsHub, IGroupsHubContract> contract, GroupsContext groupsContext)
 {
     _contract      = contract;
     _groupsContext = groupsContext;
 }
Beispiel #18
0
 public GetMembersHandler(GroupsContext context)
 {
     _context = context;
 }
 public RoleAddedToMemberEventHandler(IHubContext <GroupsHub, IGroupsHubContract> contract, GroupsContext groupsContext)
 {
     _contract      = contract;
     _groupsContext = groupsContext;
 }
 public ChannelMemberPermissionOverridesChangedEventHandler(IHubContext <GroupsHub, IGroupsHubContract> contract, GroupsContext groupsContext)
 {
     _contract      = contract;
     _groupsContext = groupsContext;
 }
Beispiel #21
0
 public RoleRemovedFromMemberEventHandler(IHubContext <GroupsHub, IGroupsHubContract> contract,
                                          GroupsContext groupsContext)
 {
     _contract      = contract;
     _groupsContext = groupsContext;
 }
Beispiel #22
0
 public GetInvitationsHandler(GroupsContext context)
 {
     _context = context;
 }
Beispiel #23
0
 public InvitationRepository(GroupsContext context)
 {
     _context = context;
 }
Beispiel #24
0
 public SpecialisationRepository(GroupsContext dbContext)
 {
     _dbContext = dbContext;
 }
Beispiel #25
0
 public GetGroupsHandler(GroupsContext context)
 {
     _context = context;
 }
 public GroupRepository(GroupsContext context) : base(context)
 {
 }
 public MessageCreatedEventHandler(IHubContext <GroupsHub, IGroupsHubContract> hubContext,
                                   GroupsContext context)
 {
     _hubContext = hubContext;
     _context    = context;
 }
Beispiel #28
0
 public SubgroupRepository(GroupsContext dbContext)
 {
     _dbContext = dbContext;
 }
Beispiel #29
0
 public GroupRepository(GroupsContext groupContext)
 {
     db = groupContext;
 }