Added a second implementation (#21944)

So it will highlight, that an interface can have multiple implementations (which differs) at the same time
This commit is contained in:
Max Dionysius
2018-11-17 23:37:20 +01:00
committed by Christopher McCormack
parent f7199d8a8d
commit 8e5e3a7db0

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