public UserWithPermissionsContract ToContract() { return(new UserWithPermissionsContract { Active = this.Active, GroupId = this.GroupId, Id = this.Id, Name = this.Name, OwnedArtistEntries = OwnedArtists.ToArray(), AdditionalPermissions = new HashSet <PermissionToken>(Permissions.Where(p => p.HasFlag).Select(p => PermissionToken.GetById(p.PermissionType.Id))) }); }
public ServerOnlyUserWithPermissionsContract ToContract() { return(new ServerOnlyUserWithPermissionsContract { Active = Active, Email = Email ?? string.Empty, GroupId = GroupId, Id = Id, Name = Name, OwnedArtistEntries = OwnedArtists.ToArray(), Poisoned = Poisoned, Supporter = Supporter, AdditionalPermissions = new HashSet <PermissionToken>(Permissions.Where(p => p.HasFlag).Select(p => PermissionToken.GetById(p.PermissionType.Id))) }); }