I am confused on how to use a namespace. I understand that a namespace is a way to group a variety of different classes into one section. My problem is I don't understand how to use such a namespace.
For example lets say I create
using System;
namespace MyMath
{
static class MyOperations
{
public static int MyAdd(int x, int y)
{
return x + y;
}
}
}
This is created in a seperate project in C#.
Now what if I want to use this namespace in a different project to use my method how do I go about doing that?
using System;
using MyMath;
namespace Test
{
class Program
{
static void Main(string[] args)
{
int sum = MyOperations.Add(5, 10);
}
}
}
This will give me an error. I don't understand where I put the Program.cs of the MyMath project to make it useable in the other project.