Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Generics
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public class EntityNotFoundException<T> : Exception {} public class EntityStore<T> { public T GetEntity(int key) { throw new EntityNotFoundException<T>(); } } public class PlayerEntity {} //... public static void Main(string[] args) { EntityStore<PlayerEntity> entityStore = new EntityStore<PlayerEntity>(); try { entityStore.GetEntity(6); } catch (EntityNotFoundException<PlayerEntity>) { Console.WriteLine("Player not found."); } catch (Exception) { Console.WriteLine("Unexpected error."); } } } }
run
|
edit
|
history
|
help
0
Bridge Design Patern
squaredigits
C# - Date Validation
Func Delegate
Compiler
How to Count Occurrences of a Word in a String (LINQ) (C#)
23
Клас cstatic
checker
RGEFCSZX