Reputation: 1274
I have options to use both SQL Server and PostgresSQL databases. In some classes, I have the following attribute
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
used to decorate to class properties:
public class MyClass
{
#if define PostgresSQL
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
#endif
public DateTime SysStartTime { get; set; }
}
I have this appsettings.json
file:
{
"Database": {
"DatabaseType": "PostgresSQL"
}
}
How do I associate the value in appsettings.json
to the value in #if define
directive?
Upvotes: 0
Views: 102