Receiving this error:
Error 4 'ZoneUpdates.Models.PgeDataContext.PgeDataContext(string, System.Data.Linq.Mapping.MappingSource)' must declare a body because it is not marked abstract, extern, or partial C:\Code\ZoneUpdates\ZoneUpdates\Models\PgeDataContext.cs 18 16 ZoneUpdates
Error 6 'ZoneUpdates.Models.ZoneObject.SendPropertyChanged(string)' must declare a body because it is not marked abstract, extern, or partial C:\Code\ZoneUpdates\ZoneUpdates\Models\PgeDataContext.cs 42 32 ZoneUpdates
Basically 13 errors between these four classes (two shown following).
I’m using 4.0 and I’ve basically copy and pasted this code from another project where it works as expected. I’ve tried changing the classes to partial, to no avail. Any pointers is appreciated.
[Database(Name = "Pge_Dev")]
public class PgeDataContext : DataContext
{
public PgeDataContext(IDbConnection connection);
public PgeDataContext(string dsn);
public PgeDataContext(
IDbConnection connection,
System.Data.Linq.Mapping.MappingSource mappingSource);
public PgeDataContext(
string connection,
System.Data.Linq.Mapping.MappingSource mappingSource);
public Table<ZoneObject> ZoneObject { get; set; }
public Table<ZoneObjType> ZoneObjType { get; set; }
public Table<ZoneTypeBridge> ZoneTypeBridge { get; set; }
}
[Table(Name = "dbo.ZoneObject")]
public class ZoneObject : INotifyPropertyChanging, INotifyPropertyChanged
{
public ZoneObject();
[Column(Storage = "ID", DbType = "Int NOT NULL")]
public int ID { get; set; }
[Column(Storage = "Name", DbType = "nvarchar(30)")]
public int Name { get; set; }
[Column(Storage = "Value", DbType = "bigint")]
public int Value { get; set; }
[Column(Storage = "CancurrencyID", DbType = "Int NOT NULL")]
public int ConcurrencyID { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangingEventHandler PropertyChanging;
protected virtual void SendPropertyChanged(string propertyName);
protected virtual void SendPropertyChanging();
}
Examples of errors
Constructors without body
=> you have to declare a body
Methods without body
protected virtual void SendPropertyChanged(string propertyName);=> You have to declare a body for non abstract, extern or partial methods, as stated in your error message
protected virtual void SendPropertyChanged(string propertyName) {/*blabla*/
}