jbogard / ContosoUniversityCore

MIT License
590 stars 150 forks source link

Instructor.OfficeAssignment and Instructor.HireDate have private setters, causing build errors #3

Closed jonsagara closed 7 years ago

jonsagara commented 7 years ago

The two properties are declared in Instructor.cs as follows:

public DateTime HireDate { get; private set; }
public virtual OfficeAssignment OfficeAssignment { get; private set; }

When I try to build the project, I get these errors:

C:\{snip}\IndexTests.cs(37,17): error CS0200: Property or indexer 'Instructor.HireDate' cannot be assigned to -- it is read only
C:\{snip}\Delete.cs(75,17): error CS0272: The property or indexer 'Instructor.OfficeAssignment' cannot be used in this context because the set accessor is inaccessible

If I remove private from both setters, the solution builds fine. Is this the proper fix, or do those properties need to keep their setters as private? If the former, shall I submit a pull request?

Thanks,

Jon

Environment info:

jbogard commented 7 years ago

No just an inadvertent commit and push on my part :(