Exemplo n.º 1
0
#pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.
        internal static void ConfigureModel(ModelBuilder model)
        {
            model.Entity <User>()
            .HasIndex(d => d.Name)
            .IncludeProperties(u => u.Id);
            model.Entity <User>()
            .HasAlternateKey(d => d.GithubId);

            User_Group_Join.ConfigureModel(model);
        }
Exemplo n.º 2
0
#pragma warning restore CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.

        public void AddGroup(Group group)
        {
            if (Groups.Any(j => j.GroupId == group.Id))
            {
                return;
            }
            var joiner = new User_Group_Join
            {
                UserId  = Id,
                GroupId = group.Id,
                User    = this,
                Group   = group
            };

            Groups.Add(joiner);
            group.Users.Add(joiner);
        }