Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

IConnectionFactory is missing HostName#1605

astaerk started this conversation inGeneral
Jun 18, 2024· 2 comments· 2 replies
Discussion options

I was trying to inject an IConnectionFactory and then use it to create a connection.
But the HostName property of the ConnectionFactory is missing on the IConnectionFactory interface.

Reproduction steps

This code

IConnectionFactory connectionFactory = new ConnectionFactory();connectionFactory.HostName = "hostName";

leads to the compilation error

CS1061'IConnectionFactory' does not contain a definition for 'HostName' and no accessible extension method 'HostName' accepting a first argument of type 'IConnectionFactory' could be found (are you missing a using directive or an assembly reference?)

Expected behavior

The property HostName of the ConnectionFactory is available on the IConnectionFactory interface.
Therefore the above code compiles without any error.

Additional context

No response

You must be logged in to vote

Replies: 2 comments 2 replies

Comment options

We cannot suggest much since you haven't shared what version you use. We do not guess in this community.

Inmain (future 7.0), this is the case becauseindividual connection methods accept a list of endpoints to use. This is a reasonable API design choice.

You must be logged in to vote
0 replies
Comment options

I'm using version 6.8.1, sorry for not including that information.

Actually I don't even need a suggestion what to do, because in the end I had to use the CreateConnection overload with IEnumerable for totally different reasons anyway.

The HostName property is used in many examples, although not on the interface but on the class. So for the sake of correctness I wanted to let you know about the missing property. Should be an easy fix after all.

But feel free to reject this issue if you don't think it is relevant.

You must be logged in to vote
2 replies
@lukebakken
Comment options

If you must useIConnectionFactory, use theUri property.

Note that version 7 will ship soon and it's too late to change these interfaces.

Version 8 will probably do away with most or all interfaces in this library, and use .NET types as much as possible (likeSystem.Net.Endpoint)

@astaerk
Comment options

Thank you for that information. I'll keep that in mind.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
3 participants
@astaerk@michaelklishin@lukebakken
Converted from issue

This discussion was converted from issue #1605 on June 18, 2024 15:08.


[8]ページ先頭

©2009-2025 Movatter.jp