Message from @sum
Discord ID: 480361035736285184
for example, my `WikiPageListRepository` could also be `MySQLWikiPageListRepository`
`VideoSearchEngine` could be `HttpVideoSearchEngine`
but in the end, all those interfaces expose a tiny bit of replaceable functionality
tbh I'd thought that since they all use Search part then linkin them to ISearch should be enough
But then again I'm not the one hosting porn indexing site
ISearch would be waaaay to big
`ISearchQueryGenerator` generates search queries for the links
`SearchQueryGenerator` implementation does this, using the HTTP Request
soon, I will have a new implementation, that does this out of the request log
`IVideoSearchEngine` is a very simple interface
it allows you to search videos
the implementation of `IVideoSearchEngine` uses ElasticSearch
Now I could substitute this with an implementation running Lucene and use both at the same time if I was retarded
because I always only use `IVideoSearchEngine` and never the concrete implementation
that's the reason for having an interface for everything
also what you saw there is only the DI container
the DI container needs exactly ONE interface and the classes it passes through
```csharp
public interface IExample {
IExample Test(string name);
}```
But maybe because I haven't experienced much with interfaces at all
you can have a fluent interface
```csharp
something.WithThat().WithThis()```
that's what it is for
the implementation then returns itself
It kinda makes sense that you could do it. Guess I need more IRL programming rather than write programs to pass tasks
the difference is clear:
```csharp
var url = searchqueryGenerator.WithTerm("asian").WithPage(13).WithOrientation(Orientation.Straight).Compile();```
vs
```csharp
searchqueryGenerator.WithTerm("asian");
searchqueryGenerator.WithPage(13);
searchqueryGenerator.WithOrientation(Orientation.Straight)
var url = searchqueryGenerator.Compile();
```
depending on the scenario, either 1 or 2 is the more readable one
Why not
```csharp
var url = searchQueryGenerator.WithTerm("asian")
.WithPage(13)
.WithOrientation(Orientation,Straight)
.Compile();```
yes that's the same, that's version 1 but with new lines
but in order to have this, it must return itself
Why not just go with ver1.5 aka new lines
I copy pasted that from my viewmodel
I use it inline HTML
I don't want to have newlines in my `<a href`
it really depends on your use case
my explanation was more about why it needs to return itself
Great. Scared half to death by light. 👍
Fucking reflection on the glasses as I turned my head.
If you had a gun you could've neutralized the threat <:tipsfedora:383326576609329162>