Added a second implementation (#21944)
So it will highlight, that an interface can have multiple implementations (which differs) at the same timepull/21952/head^2
parent
f7199d8a8d
commit
8e5e3a7db0
|
@ -55,3 +55,21 @@ public class UserHungry : IUserFavoriteFood
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
Every implementation can be different:
|
||||
```csharp
|
||||
public class AnotherUserHungry : IUserFavoriteFood
|
||||
{
|
||||
public AddFood()
|
||||
{
|
||||
// DIFFERENT Implementation:
|
||||
// A method to add vegan food.
|
||||
}
|
||||
|
||||
public Task<User> EatFavoriteFood(int id)
|
||||
{
|
||||
// DIFFERENT Implementation:
|
||||
// A method to Eat only vegan food by id.
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue