Refactor entity properties for nullability and requirements
Removed nullable indicators from string properties in BaseEntity.cs, ClientUser.cs, Group.cs, and User.cs. The Username property in User.cs is now marked as required for .NET 7 or greater, improving data integrity and reducing null reference risks.
This commit is contained in:
parent
bc44de63ee
commit
5d3f73bb13
@ -20,8 +20,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
#if NET7_0_OR_GREATER
|
#if NET7_0_OR_GREATER
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
AddedWho
|
AddedWho { get; set; }
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
[Column("CHANGED_WHO")]
|
[Column("CHANGED_WHO")]
|
||||||
@ -29,8 +28,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
#if NET7_0_OR_GREATER
|
#if NET7_0_OR_GREATER
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
ChangedWho
|
ChangedWho { get; set; }
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
//TODO: assign it to default value in create dto, not here!
|
//TODO: assign it to default value in create dto, not here!
|
||||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
|
|||||||
@ -28,8 +28,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
#if NET7_0_OR_GREATER
|
#if NET7_0_OR_GREATER
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Comment
|
Comment { get; set; }
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
[Column("ADDED_WHO")]
|
[Column("ADDED_WHO")]
|
||||||
@ -37,8 +36,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
#if NET7_0_OR_GREATER
|
#if NET7_0_OR_GREATER
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
AddedWho
|
AddedWho { get; set; }
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
[DefaultValue("GETDATE()")]
|
[DefaultValue("GETDATE()")]
|
||||||
|
|||||||
@ -32,8 +32,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
#if NET7_0_OR_GREATER
|
#if NET7_0_OR_GREATER
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
Comment
|
Comment { get; set; }
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
// TODO: this column should be assigned by triggers. despite this it is not null and this is problem for creation. talk with others
|
// TODO: this column should be assigned by triggers. despite this it is not null and this is problem for creation. talk with others
|
||||||
[Required]
|
[Required]
|
||||||
|
|||||||
@ -26,7 +26,11 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
[Required]
|
[Required]
|
||||||
[Column("USERNAME")]
|
[Column("USERNAME")]
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
public string Username { get; set; }
|
public
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
required
|
||||||
|
#endif
|
||||||
|
string Username { get; set; }
|
||||||
|
|
||||||
[Column("SHORTNAME")]
|
[Column("SHORTNAME")]
|
||||||
[StringLength(30)]
|
[StringLength(30)]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user