Jay Janarthanan Jay Janarthanan - 25 days ago 9
C# Question

How can I have a class called "System", using C# 6.0

I need to create and use a class that will be called System.cs (please don't ask why :-).

The current option is to refer it with the namespace, for example

NameSpace.System.Debug("Hi");


Putting it in namespace like

using System = NameSpace.System;


Does not work either.

All I want is to write some thing like
System.Debug("Hi")
and get my implementation called.

Jay

Answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace test
{
    public class Program
    {
        public static void Main(string[] args)
        {
            System.Debug("things");
        }
    }

    public static class System
    {
        public static void Debug(string message)
        {
            Console.WriteLine(message);
        }

    }
}