This question is locked. New answers and comments are not allowed.
Hi!
I'm trying to create my first project using OpenAccess but i'm stuck at a part where I would like to inherit my 'table' classes from 1 base class that contains properties that are in every 'table' class.
my base class:
Example of a 'table' class that inherits the base class:
The properties of the base class are not in the database?
only the following properties are created:
- products_id (probably automatically created by openaccess)
- product_name
- price
Is it possible to include the properties from the base class in every table-class?
I'm trying to create my first project using OpenAccess but i'm stuck at a part where I would like to inherit my 'table' classes from 1 base class that contains properties that are in every 'table' class.
my base class:
public
abstract
class
DataEntity : IEntity {
[Column(IsPrimaryKey =
true
, IsBackendCalculated =
true
)]
public
int
Id {
get
;
set
; }
[Column(
"Created"
)]
public
DateTime Created {
get
;
set
; }
[Column(
"Modified"
)]
public
DateTime Modified {
get
;
set
; }
[Column(
"Deleted"
)]
public
bool
IsDeleted {
get
;
set
; }
public
DataEntity() {
Created = DateTime.Now;
Modified = DateTime.Now;
}
}
Example of a 'table' class that inherits the base class:
[Table(Name =
"Products"
, UpdateSchema=
true
)]
public
class
Product : DataEntity, IEntity {
public
string
ProductName {
get
;
set
; }
public
decimal
Price {
get
;
set
; }
}
The properties of the base class are not in the database?
only the following properties are created:
- products_id (probably automatically created by openaccess)
- product_name
- price
Is it possible to include the properties from the base class in every table-class?