Add framework-specific handling for Id property
Introduce conditional compilation to differentiate `Id` property
behavior between `NET` and `NETFRAMEWORK` environments. For `NET`,
the `Id` property is of type `EnvelopeType` with `[Key]` and
`[Column("GUID")]` attributes. For `NETFRAMEWORK`, the `Id` property
is of type `int` with a default value of `0`, retaining `[Key]`,
`[DatabaseGenerated(DatabaseGeneratedOption.Identity)]`, and
`[Column("GUID")]` attributes. These changes ensure compatibility
and proper configuration across frameworks.
This commit is contained in:
@@ -11,10 +11,18 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Table("TBSIG_ENVELOPE_TYPE", Schema = "dbo")]
|
||||
public class EnvelopeTypeDefaults
|
||||
{
|
||||
#if NET
|
||||
|
||||
[Key]
|
||||
[Column("GUID")]
|
||||
public EnvelopeType Id { get; set; }
|
||||
#elif NETFRAMEWORK
|
||||
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("GUID")]
|
||||
public EnvelopeType Id { get; set; } = 0;
|
||||
public int Id { get; set; } = 0;
|
||||
#endif
|
||||
|
||||
[Required]
|
||||
[Column("TITLE", TypeName = "nvarchar(128)")]
|
||||
|
||||
Reference in New Issue
Block a user