update models to use new ModelBase

This commit is contained in:
Shaun Walker 2022-10-26 17:26:46 -04:00
parent 1daa9575db
commit 4499d55464
17 changed files with 18 additions and 247 deletions

View File

@ -7,7 +7,7 @@ namespace Oqtane.Models
/// <summary> /// <summary>
/// An Alias maps a url like `oqtane.my` or `oqtane.my/products` to a <see cref="Oqtane.Models.Site"/> and <see cref="Oqtane.Models.Tenant"/> /// An Alias maps a url like `oqtane.my` or `oqtane.my/products` to a <see cref="Oqtane.Models.Site"/> and <see cref="Oqtane.Models.Tenant"/>
/// </summary> /// </summary>
public class Alias : IAuditable public class Alias : ModelBase
{ {
/// <summary> /// <summary>
/// The primary ID for internal use. It's also used in API calls to identify the site. /// The primary ID for internal use. It's also used in API calls to identify the site.
@ -36,18 +36,6 @@ namespace Oqtane.Models
/// </summary> /// </summary>
public bool IsDefault { get; set; } public bool IsDefault { get; set; }
/// <inheritdoc />
public string CreatedBy { get; set; }
/// <inheritdoc />
public DateTime CreatedOn { get; set; }
/// <inheritdoc />
public string ModifiedBy { get; set; }
/// <inheritdoc />
public DateTime ModifiedOn { get; set; }
/// <summary> /// <summary>
/// The path contains the url-part after the first slash. /// The path contains the url-part after the first slash.
/// * If the Name is `oqtane.me` the Path is empty /// * If the Name is `oqtane.me` the Path is empty

View File

@ -7,7 +7,7 @@ namespace Oqtane.Models
/// <summary> /// <summary>
/// Describes a File in Oqtane /// Describes a File in Oqtane
/// </summary> /// </summary>
public class File : IAuditable public class File : ModelBase
{ {
/// <summary> /// <summary>
/// ID to identify the file /// ID to identify the file
@ -55,22 +55,6 @@ namespace Oqtane.Models
/// </summary> /// </summary>
public string Description { get; set; } public string Description { get; set; }
#region IAuditable Properties
/// <inheritdoc />
public string CreatedBy { get; set; }
/// <inheritdoc />
public DateTime CreatedOn { get; set; }
/// <inheritdoc />
public string ModifiedBy { get; set; }
/// <inheritdoc />
public DateTime ModifiedOn { get; set; }
#endregion
#region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet #region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet
public string DeletedBy { get; set; } public string DeletedBy { get; set; }

View File

@ -6,7 +6,7 @@ namespace Oqtane.Models
/// <summary> /// <summary>
/// Describes a Folder in Oqtane /// Describes a Folder in Oqtane
/// </summary> /// </summary>
public class Folder : IAuditable public class Folder : ModelBase
{ {
/// <summary> /// <summary>
/// ID to identify the folder /// ID to identify the folder
@ -59,22 +59,6 @@ namespace Oqtane.Models
/// </summary> /// </summary>
public bool IsSystem { get; set; } public bool IsSystem { get; set; }
#region IAuditable Properties
/// <inheritdoc />
public string CreatedBy { get; set; }
/// <inheritdoc />
public DateTime CreatedOn { get; set; }
/// <inheritdoc />
public string ModifiedBy { get; set; }
/// <inheritdoc />
public DateTime ModifiedOn { get; set; }
#endregion
#region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet #region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet
public string DeletedBy { get; set; } public string DeletedBy { get; set; }

View File

@ -6,7 +6,7 @@ namespace Oqtane.Models
/// Definition of a Job / Task which is run on the server. /// Definition of a Job / Task which is run on the server.
/// When Jobs run, they create a <see cref="JobLog"/> /// When Jobs run, they create a <see cref="JobLog"/>
/// </summary> /// </summary>
public class Job : IAuditable public class Job : ModelBase
{ {
/// <summary> /// <summary>
/// Internal ID /// Internal ID
@ -68,21 +68,5 @@ namespace Oqtane.Models
/// Todo: todoc - unsure what this does /// Todo: todoc - unsure what this does
/// </summary> /// </summary>
public int RetentionHistory { get; set; } public int RetentionHistory { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
} }
} }

View File

@ -7,7 +7,7 @@ namespace Oqtane.Models
/// Language Information for <see cref="Site"/>s /// Language Information for <see cref="Site"/>s
/// TODO: todoc - unclear how this is different from <see cref="Culture"/> /// TODO: todoc - unclear how this is different from <see cref="Culture"/>
/// </summary> /// </summary>
public class Language : IAuditable public class Language : ModelBase
{ {
/// <summary> /// <summary>
/// Internal ID /// Internal ID
@ -40,21 +40,5 @@ namespace Oqtane.Models
/// Version of the satellite assembly /// Version of the satellite assembly
/// </summary> /// </summary>
public string Version { get; set; } public string Version { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
} }
} }

View File

@ -8,7 +8,7 @@ namespace Oqtane.Models
/// <summary> /// <summary>
/// Describes a Module _Instance_ which will be shown on a page. This is different from a <see cref="ModuleDefinition"/> which describes a Module. /// Describes a Module _Instance_ which will be shown on a page. This is different from a <see cref="ModuleDefinition"/> which describes a Module.
/// </summary> /// </summary>
public class Module : IAuditable public class Module : ModelBase
{ {
/// <summary> /// <summary>
/// The ID of this instance /// The ID of this instance
@ -30,18 +30,6 @@ namespace Oqtane.Models
/// </summary> /// </summary>
public bool AllPages { get; set; } public bool AllPages { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
#region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet #region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet
[NotMapped] [NotMapped]

View File

@ -8,7 +8,7 @@ namespace Oqtane.Models
/// Describes a Module type (Definition) in Oqtane. /// Describes a Module type (Definition) in Oqtane.
/// The available Modules are determined at StartUp. /// The available Modules are determined at StartUp.
/// </summary> /// </summary>
public class ModuleDefinition : IAuditable public class ModuleDefinition : ModelBase
{ {
[PrivateApi("The constructor is probably just for internal use and shouldn't appear in the docs")] [PrivateApi("The constructor is probably just for internal use and shouldn't appear in the docs")]
public ModuleDefinition() public ModuleDefinition()
@ -63,19 +63,6 @@ namespace Oqtane.Models
/// </summary> /// </summary>
public string Version { get; set; } public string Version { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
// additional IModule properties // additional IModule properties
[NotMapped] [NotMapped]
public string Owner { get; set; } public string Owner { get; set; }

View File

@ -7,7 +7,7 @@ namespace Oqtane.Models
/// <summary> /// <summary>
/// Describes a Page in Oqtane /// Describes a Page in Oqtane
/// </summary> /// </summary>
public class Page : IAuditable, IDeletable public class Page : ModelBase, IDeletable
{ {
/// <summary> /// <summary>
/// Id of the Page /// Id of the Page
@ -77,19 +77,6 @@ namespace Oqtane.Models
public int? UserId { get; set; } public int? UserId { get; set; }
public bool IsPersonalizable { get; set; } public bool IsPersonalizable { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
#region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet #region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet
public string DeletedBy { get; set; } public string DeletedBy { get; set; }

View File

@ -5,7 +5,7 @@ namespace Oqtane.Models
/// <summary> /// <summary>
/// Information about a <see cref="Module"/> instance on a <see cref="Page"/> /// Information about a <see cref="Module"/> instance on a <see cref="Page"/>
/// </summary> /// </summary>
public class PageModule : IAuditable, IDeletable public class PageModule : ModelBase, IDeletable
{ {
/// <summary> /// <summary>
/// Internal ID to identify this instance. /// Internal ID to identify this instance.
@ -42,19 +42,6 @@ namespace Oqtane.Models
/// </summary> /// </summary>
public string ContainerType { get; set; } public string ContainerType { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
#region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet #region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet
public string DeletedBy { get; set; } public string DeletedBy { get; set; }

View File

@ -6,7 +6,7 @@ namespace Oqtane.Models
/// Permission information for anything in Oqtane. /// Permission information for anything in Oqtane.
/// Things in Oqtane are identified as Entities, so anything that can be identified can be described here. /// Things in Oqtane are identified as Entities, so anything that can be identified can be described here.
/// </summary> /// </summary>
public class Permission : IAuditable public class Permission : ModelBase
{ {
/// <summary> /// <summary>
/// Internal ID storing this information. /// Internal ID storing this information.
@ -52,22 +52,6 @@ namespace Oqtane.Models
/// </summary> /// </summary>
public bool IsAuthorized { get; set; } public bool IsAuthorized { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
/// <summary> /// <summary>
/// Reference to the <see cref="Role"/> based on the <see cref="RoleId"/> - can be nullable. /// Reference to the <see cref="Role"/> based on the <see cref="RoleId"/> - can be nullable.
/// </summary> /// </summary>

View File

@ -6,7 +6,7 @@ namespace Oqtane.Models
/// A single Profile Property information of a <see cref="User"/>. /// A single Profile Property information of a <see cref="User"/>.
/// So a user will have many of these to fully describe his Profile. /// So a user will have many of these to fully describe his Profile.
/// </summary> /// </summary>
public class Profile : IAuditable public class Profile : ModelBase
{ {
/// <summary> /// <summary>
/// Internal ID /// Internal ID
@ -68,21 +68,5 @@ namespace Oqtane.Models
/// This gives possible values for dropdown input fields. /// This gives possible values for dropdown input fields.
/// </summary> /// </summary>
public string Options { get; set; } public string Options { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
} }
} }

View File

@ -5,7 +5,7 @@ namespace Oqtane.Models
/// <summary> /// <summary>
/// Describes a Security Role in Oqtane. /// Describes a Security Role in Oqtane.
/// </summary> /// </summary>
public class Role : IAuditable public class Role : ModelBase
{ {
/// <summary> /// <summary>
/// Primary ID /// Primary ID
@ -32,18 +32,5 @@ namespace Oqtane.Models
/// </summary> /// </summary>
public bool IsAutoAssigned { get; set; } public bool IsAutoAssigned { get; set; }
public bool IsSystem { get; set; } public bool IsSystem { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
} }
} }

View File

@ -5,7 +5,7 @@ namespace Oqtane.Models
/// <summary> /// <summary>
/// A setting for any kind of object like <see cref="Tenant"/>, <see cref="Site"/>, <see cref="Page"/>, <see cref="Module"/> etc. /// A setting for any kind of object like <see cref="Tenant"/>, <see cref="Site"/>, <see cref="Page"/>, <see cref="Module"/> etc.
/// </summary> /// </summary>
public class Setting : IAuditable public class Setting : ModelBase
{ {
/// <summary> /// <summary>
/// ID in the Database - mainly used to later update an existing setting. /// ID in the Database - mainly used to later update an existing setting.
@ -36,18 +36,5 @@ namespace Oqtane.Models
/// Indicates if this setting is private - indicating it should be maintained on the server and not sent to the client /// Indicates if this setting is private - indicating it should be maintained on the server and not sent to the client
/// </summary> /// </summary>
public bool IsPrivate { get; set; } public bool IsPrivate { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
} }
} }

View File

@ -6,7 +6,7 @@ namespace Oqtane.Models
/// Describes a Tenant in Oqtane. /// Describes a Tenant in Oqtane.
/// Tenants can contain multiple <see cref="Site"/>s and have all their data in a separate Database. /// Tenants can contain multiple <see cref="Site"/>s and have all their data in a separate Database.
/// </summary> /// </summary>
public class Tenant : IAuditable public class Tenant : ModelBase
{ {
/// <summary> /// <summary>
/// ID of the Tenant. /// ID of the Tenant.
@ -30,19 +30,6 @@ namespace Oqtane.Models
/// New in v2.1.0 /// New in v2.1.0
/// </remarks> /// </remarks>
public string DBType { get; set; } public string DBType { get; set; }
public string Version { get; set; } public string Version { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
} }
} }

View File

@ -6,7 +6,7 @@ namespace Oqtane.Models
/// <summary> /// <summary>
/// Describes a User in Oqtane. /// Describes a User in Oqtane.
/// </summary> /// </summary>
public class User : IAuditable, IDeletable public class User : ModelBase, IDeletable
{ {
/// <summary> /// <summary>
/// ID of this User. /// ID of this User.
@ -70,19 +70,6 @@ namespace Oqtane.Models
/// </summary> /// </summary>
[NotMapped] [NotMapped]
public string Roles { get; set; } public string Roles { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
#region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet #region Extended IAuditable Properties, may be moved to an Interface some day so not documented yet

View File

@ -5,7 +5,7 @@ namespace Oqtane.Models
/// <summary> /// <summary>
/// Assigns a <see cref="Role"/> to a <see cref="User"/> /// Assigns a <see cref="Role"/> to a <see cref="User"/>
/// </summary> /// </summary>
public class UserRole : IAuditable public class UserRole : ModelBase
{ {
/// <summary> /// <summary>
/// Id of this assignment /// Id of this assignment
@ -31,19 +31,6 @@ namespace Oqtane.Models
/// </summary> /// </summary>
public DateTime? ExpiryDate { get; set; } public DateTime? ExpiryDate { get; set; }
#region IAuditable Properties
/// <inheritdoc/>
public string CreatedBy { get; set; }
/// <inheritdoc/>
public DateTime CreatedOn { get; set; }
/// <inheritdoc/>
public string ModifiedBy { get; set; }
/// <inheritdoc/>
public DateTime ModifiedOn { get; set; }
#endregion
/// <summary> /// <summary>
/// Direct reference to the <see cref="Role"/> object. /// Direct reference to the <see cref="Role"/> object.
/// TODO: todoc - is this always populated? /// TODO: todoc - is this always populated?

View File

@ -7,16 +7,11 @@ using Oqtane.Documentation;
namespace Oqtane.Modules.HtmlText.Models namespace Oqtane.Modules.HtmlText.Models
{ {
[PrivateApi("Mark HtmlText classes as private, since it's not very useful in the public docs")] [PrivateApi("Mark HtmlText classes as private, since it's not very useful in the public docs")]
public class HtmlText : IAuditable public class HtmlText : ModelBase
{ {
[Key] [Key]
public int HtmlTextId { get; set; } public int HtmlTextId { get; set; }
public int ModuleId { get; set; } public int ModuleId { get; set; }
public string Content { get; set; } public string Content { get; set; }
public string CreatedBy { get; set; }
public DateTime CreatedOn { get; set; }
public string ModifiedBy { get; set; }
public DateTime ModifiedOn { get; set; }
} }
} }