Shubha Mondal

Shubha Mondal

  • NA
  • 149
  • 1.1k

Calling interface driven method from one project to another

Aug 21 2017 6:54 AM
namespace Project1
{
public interface IInterface1
{
void Method();
}
public interface IInterface2 : IInterface1
{
void Method();
void Method2();
}
// Here we are implementing methods for get and sent data to database
public class GetSentData: IInterface1
(
void Method();
void Method2();
)
}
note: We are making a .dll of above mentions interfaces and class.

//This is a another solution
//I add reference of Project1 into project2
Namespace project2
{
public class Acess
{
//Here we want to call above class method by using the interface driven class
IInterface1 myinterface=new GetSentData();
myinterface.Method(); 
//Like This but am getting error as: Object is not set to an instance of object
}
}
//Please Suggest with your valuable answers

Answers (1)