Added a second implementation (#21944)

So it will highlight, that an interface can have multiple implementations (which differs) at the same time
pull/21952/head^2
Max Dionysius 2018-11-17 23:37:20 +01:00 committed by Christopher McCormack
parent f7199d8a8d
commit 8e5e3a7db0
1 changed files with 18 additions and 0 deletions

View File

@ -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.
}
}
```