I have a class:
public class classParty
{
private int _arrivedCount;
public int PartyID {get; private set;}
public DateTime PartyDate {get; private set;}
public int ArrivedCount
{
get
{
return _arrivedCount;
}
set
{
_arrivedCount = value;
}
}
}
I can map the PartyId and the PartyDate but I don’t have a column for ArrivedCount (it’s a moment in time count, it doesn’t persist).
How do I tell EF 4.1 to stop looking for a column named “ArrivedCount”? It’s not in the table. It’s not going to be in the table. It’s simply a property of the object and that’s all.
Thanks in advance.
EDIT:
Here’s the Fluent API configuration for classParty.
public class PartyConfiguration : EntityTypeConfiguration<classParty>
{
public PartyConfiguration()
: base()
{
HasKey(p => p.PartyID);
Property(p => p.PartyID)
.HasColumnName("PartyID")
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
.IsRequired();
Property(p => p.PartyDate)
.HasColumnName("PartyDate")
.IsRequired();
ToTable("Party");
}
}
1 Answer