You are on page 1of 2

---Interface

namespace Capgemini.CSharp.Day6
{
public interface IBuildingContractor
{
void GetMasion();
void GetElectrician();
void GetPlumber();
}

//Interafce inheritance is Not Recommended


public interface IBuildingContractorAdvanced //: IBuildingContractor
//Inheritance
{
void InteriorDecoration();
}

public interface IContractName


{
string ContractorName { get; set; }
}
}

---OwnBuilding.cs
using System;

namespace Capgemini.CSharp.Day6
{
public class MyOwnBuilding : IBuildingContractorAdvanced, IBuildingContractor,
IContractName // Multiple Implementation
{
public string ContractorName { get => throw new NotImplementedException();
set => throw new NotImplementedException(); }

public void GetElectrician()


{
throw new NotImplementedException();
}

public void GetMasion()


{
throw new NotImplementedException();
}

public void GetPlumber()


{
throw new NotImplementedException();
}

public void InteriorDecoration()


{
throw new NotImplementedException();
}
}

---GovtBuilding.cs
using System;
namespace Capgemini.CSharp.Day6
{
class GovtBuilding : IBuildingContractor, IContractName
{
public string ContractorName { get; set; }

public void GetElectrician()


{
throw new NotImplementedException();
}

public void GetMasion()


{
throw new NotImplementedException();
}

public void GetPlumber()


{
throw new NotImplementedException();
}
}
}

---ExistingHouse.cs
using System;

namespace Capgemini.CSharp.Day6
{
class ExistingBuilding : IBuildingContractorAdvanced, IContractName //Multiple
Implementation
{
public string ContractorName { get => throw new NotImplementedException();
set => throw new NotImplementedException(); }

public void InteriorDecoration()


{
throw new NotImplementedException();
}
}
}

You might also like