Updated `DigitalData.UserManager.Domain.csproj` to target .NET Framework 4.6.2 alongside .NET 7.0, 8.0, and 9.0. Corrected `PackageTags` from "user maanger" to "user manager" and added property groups for implicit usings and language versions. Introduced nullable reference types in entity classes (`BaseEntity`, `ClientUser`, `Group`, `User`, etc.) for enhanced type safety. Updated properties in the `User` and `UserRep` classes to use the new nullable syntax, ensuring consistency across the codebase. These changes improve compatibility with newer C# features and maintain support for multiple frameworks.
43 lines
1.0 KiB
C#
43 lines
1.0 KiB
C#
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
#if NETFRAMEWORK
|
|
using System;
|
|
#endif
|
|
|
|
namespace DigitalData.UserManager.Domain.Entities
|
|
{
|
|
public class BaseEntity
|
|
{
|
|
[Column("GUID")]
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public int Id { get; set; }
|
|
|
|
[StringLength(50)]
|
|
[Column("ADDED_WHO")]
|
|
public string
|
|
#if NET6_0_OR_GREATER
|
|
?
|
|
#endif
|
|
AddedWho
|
|
{ get; set; }
|
|
|
|
[StringLength(50)]
|
|
[Column("CHANGED_WHO")]
|
|
public string
|
|
#if NET6_0_OR_GREATER
|
|
?
|
|
#endif
|
|
ChangedWho
|
|
{ get; set; }
|
|
|
|
//TODO: assign it to default value in create dto, not here!
|
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
|
[DefaultValue("GETDATE()")]
|
|
public DateTime AddedWhen { get; set; } = DateTime.Now;
|
|
|
|
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
|
public DateTime? ChangedWhen { get; set; }
|
|
}
|
|
} |