Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApplication1
- {
- class Program
- {
- private static void Main(string[] args)
- {
- var x = new Manager<ISoccer>();
- x.GetManager();
- Console.ReadKey();
- }
- }
- public class Manager<T> where T : IBallGame, new()
- {
- public T GetManager()
- {
- return new T();
- }
- }
- public interface IBallGame
- {
- }
- public class ISoccer : IBallGame
- {
- }
- public class Soccer : ISoccer
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement