This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private int _numberOfLegs = 0; | |
| private int NumberOFLegs | |
| { | |
| get { return _numberOfLegs; } | |
| set { _numberOfLegs = value; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private int NumberOfLegs; | |
| private int GetNumberOfLegs() | |
| { | |
| return NumberOfLegs; | |
| } | |
| public void SetNumberOfLegs(int numberOfLegs) | |
| { | |
| NumberOfLegs = numberOfLegs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Cat : Animal | |
| { | |
| public new void Move() | |
| { | |
| Console.WriteLine("I am not going to do anything that my master tells me to!"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Animal : IEat, ISleep | |
| { | |
| public void Eat() | |
| { | |
| Console.WriteLine("I am eating..."); | |
| } | |
| public virtual void Move() | |
| { | |
| Console.WriteLine(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface IEat | |
| { | |
| void Eat(); | |
| void NotHungry(); | |
| } | |
| public interface ISleep | |
| { | |
| void Sleep(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Animal | |
| { | |
| public bool CanFly = false; | |
| public void Move() | |
| { | |
| Console.WriteLine("I am walking!"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Animal animal = new Animal(); | |
| animal.Move(); | |
| Cat cat = new Cat(); | |
| cat.Move(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Animal | |
| { | |
| public void Move() | |
| { | |
| Console.WriteLine("I am walking!"); | |
| } | |
| } | |
| public class Cat : Animal | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var recipes = _spoonacular.Get5Recipies("pizza").GetAwaiter().GetResult(); | |
| foreach(Recipe recipe in recipes) | |
| { | |
| Console.WriteLine(recipe.Title); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SpoonacularService : ISpoonacularService | |
| { | |
| public async Task<IEnumerable<Recipe>> Get5Recipies(String query) | |
| { | |
| List<Recipe> recipes = new List<Recipe>(); | |
| var url = $"https://api.spoonacular.com/recipes/complexSearch"; | |
| var parameters = $"?query={query}&apiKey={Consts.SpoonacularKey}&number=5"; |