I have the following interface..It has a error which i had no idea why it happened. Basically for the interface partstring DoorDescription { get; private set; }
has to remove the private set
to make it work
namespace test6
{
interface IHasExteriorDoor
{
string DoorDescription { get; private set; }
string DoorLocation { get; set; }
}
class Room : IHasExteriorDoor
{
public Room(string disc, string loc)
{
DoorDescription = disc;
DoorLocation = loc;
}
public string DoorDescription { get; private set; }
public string DoorLocation { get; set; }
}
class Program
{
static void Main(string[] args)
{
Room a = new Room("A","B");
a.DoorLocation = "alien";
//a.DoorDescription = "mars";
}
}
}