Compile error with Nested Classes
- by ProfK
I have metadata classes nested within entity classes, as I have always done, but suddenly, when I deploy to my target web site, and try and view a page, I get e.g. the following compile error:
CS0102: The type 'PvmmsModel.ActivationResource' already contains a definition for 'ActivationResourceMetadata'
My code for this type looks like below. There is only one definition of ActivationResourceMetadata:
namespace PvmmsModel
{
[DisplayName("Activation Resources")]
[DisplayColumn("Name")]
[MetadataType(typeof(ActivationResourceMetadata))]
public partial class ActivationResource
{
public class ActivationResourceMetadata
{
[ScaffoldColumn(false)]
public object ResourceId { get; set; }
[DisplayName("Cell Phone")]
public object CellPhone { get; set; }
[DisplayName("Shifts Worked or Planned")]
public object ActivationShifts { get; set; }
}
}
}
This is on an ASP.NET WebSite project.