diff --git a/src/HopFrame.Core/Configuration/HopFrameConfig.cs b/src/HopFrame.Core/Configuration/HopFrameConfig.cs index 767d91d..0a7d520 100644 --- a/src/HopFrame.Core/Configuration/HopFrameConfig.cs +++ b/src/HopFrame.Core/Configuration/HopFrameConfig.cs @@ -1,10 +1,10 @@ namespace HopFrame.Core.Configuration; -/** - * The configuration for the library - */ +/// +/// The configuration for the library +/// public sealed class HopFrameConfig { - /** The configurations for the table repositories */ + /// The configurations for the table repositories public IList Tables { get; set; } = new List(); internal HopFrameConfig() {} diff --git a/src/HopFrame.Core/Configuration/PropertyConfig.cs b/src/HopFrame.Core/Configuration/PropertyConfig.cs index 825c393..88d5dbd 100644 --- a/src/HopFrame.Core/Configuration/PropertyConfig.cs +++ b/src/HopFrame.Core/Configuration/PropertyConfig.cs @@ -1,40 +1,40 @@ namespace HopFrame.Core.Configuration; -/** - * The configuration for a single property - */ +/// +/// The configuration for a single property +/// public class PropertyConfig { - /** [GENERATED] The unique identifier for the property (usually the real property name in the model) */ + /// [GENERATED] The unique identifier for the property (usually the real property name in the model) public required string Identifier { get; init; } - /** [GENERATED] The displayed name of the Property */ + /// [GENERATED] The displayed name of the Property public required string DisplayName { get; set; } - /** [GENERATED] The real type of the property */ + /// [GENERATED] The real type of the property public required Type Type { get; set; } - /** [GENERATED] The type as wich the property should be treated */ + /// [GENERATED] The type as wich the property should be treated public required PropertyType PropertyType { get; set; } - /** Determines if the property will appear in the table */ + /// Determines if the property will appear in the table public bool Listable { get; set; } = true; - /** Determines if the table can be sorted by the property */ + /// Determines if the table can be sorted by the property public bool Sortable { get; set; } = true; - /** Determines if the table can be searched by the property */ + /// Determines if the table can be searched by the property public bool Searchable { get; set; } = true; - /** - * Determines if the value of the property can be edited - * (if true the value can still be set during creation) - */ + /// + /// Determines if the value of the property can be edited
+ /// (if true the value can still be set during creation) + ///
public bool Editable { get; set; } = true; - /** Determines if the property is visible in the creation or edit dialog */ + /// Determines if the property is visible in the creation or edit dialog public bool Creatable { get; set; } = true; - /** [GENERATED] The place (from left to right) that the property will appear in the table and editor */ + /// [GENERATED] The place (from left to right) that the property will appear in the table and editor public int OrderIndex { get; set; } internal PropertyConfig() {} @@ -46,45 +46,45 @@ public class PropertyConfig { /// [Flags] public enum PropertyType : byte { - /** Used together with another type to indicate that the value can be null */ + /// Used together with another type to indicate that the value can be null Nullable = 0b10000000, - /** Used together with another type to indicate that the property is a relation */ + /// Used together with another type to indicate that the property is a relation Relation = 0b01000000, - /** Used together with another type to indicate that the value is enumerable */ + /// Used together with another type to indicate that the value is enumerable List = 0b00100000, - /** Indicates that the value is numeric */ + /// Indicates that the value is numeric Numeric = 0x01, - /** Indicates that the value is a boolean */ + /// Indicates that the value is a boolean Boolean = 0x02, - /** Indicates that the value is a timestamp */ + /// Indicates that the value is a timestamp DateTime = 0x03, - /** Indicates that the value is a date */ + /// Indicates that the value is a date DateOnly = 0x04, - /** Indicates that the value is a time of day */ + /// Indicates that the value is a time of day TimeOnly = 0x05, - /** Indicates that the value is a list of fixed values */ + /// Indicates that the value is a list of fixed values Enum = 0x06, - /** Indicates that the value is a string */ + /// Indicates that the value is a string Text = 0x07, - /** Indicates that the value is an email */ + /// Indicates that the value is an email Email = 0x08, - /** Indicates that the value is a long string */ + /// Indicates that the value is a long string TextArea = 0x09, - /** Indicates that the value should be hidden */ + /// Indicates that the value should be hidden Password = 0x0A, - /** Indicates that the value is a phone number */ + /// Indicates that the value is a phone number PhoneNumber = 0x0B } diff --git a/src/HopFrame.Core/Configuration/TableConfig.cs b/src/HopFrame.Core/Configuration/TableConfig.cs index 051c578..c25fcc0 100644 --- a/src/HopFrame.Core/Configuration/TableConfig.cs +++ b/src/HopFrame.Core/Configuration/TableConfig.cs @@ -1,31 +1,31 @@ namespace HopFrame.Core.Configuration; -/** - * The configuration for a table - */ +/// +/// The configuration for a table +/// public class TableConfig { - /** [GENERATED] The unique identifier for the table (usually the name of the model) */ + /// [GENERATED] The unique identifier for the table (usually the name of the model) public required string Identifier { get; init; } - /** [GENERATED] The configurations for the properties of the model */ + /// [GENERATED] The configurations for the properties of the model public IList Properties { get; set; } = new List(); - /** [GENERATED] The type of the model */ + /// [GENERATED] The type of the model public required Type TableType { get; set; } - /** [GENERATED] The type identifier for the repository */ + /// [GENERATED] The type identifier for the repository public required Type RepositoryType { get; set; } - /** [GENERATED] the url of the table page */ + /// [GENERATED] the url of the table page public required string Route { get; set; } - /** [GENERATED] The displayed name of the table */ + /// [GENERATED] The displayed name of the table public required string DisplayName { get; set; } - /** A short description for the table */ + /// A short description for the table public string? Description { get; set; } - /** [GENERATED] The place (from top to bottom) that the table will appear in on the sidebar */ + /// [GENERATED] The place (from top to bottom) that the table will appear in on the sidebar public int OrderIndex { get; set; } internal TableConfig() {} diff --git a/src/HopFrame.Core/Configurators/HopFrameConfigurator.cs b/src/HopFrame.Core/Configurators/HopFrameConfigurator.cs index 23f9aab..a5378a4 100644 --- a/src/HopFrame.Core/Configurators/HopFrameConfigurator.cs +++ b/src/HopFrame.Core/Configurators/HopFrameConfigurator.cs @@ -6,11 +6,11 @@ using Microsoft.Extensions.DependencyInjection.Extensions; namespace HopFrame.Core.Configurators; -/** - * The configurator for the - */ +/// +/// The configurator for the +/// public class HopFrameConfigurator(HopFrameConfig config, IServiceCollection services) { - /** The internal config that is modified */ + /// The internal config that is modified public HopFrameConfig Config { get; } = config; internal IServiceCollection Services { get; } = services; @@ -21,7 +21,7 @@ public class HopFrameConfigurator(HopFrameConfig config, IServiceCollection serv /// The repository that handles the table /// The type of the model /// The configurator for the table - public HopFrameConfigurator AddRepository(Action>? configurator = null) where TRepository : IHopFrameRepository where TModel : notnull { + public HopFrameConfigurator AddRepository(Action>? configurator = null) where TRepository : IHopFrameRepository where TModel : class { var table = ConfigurationHelper.InitializeTable(Config, typeof(TRepository), typeof(TModel)); Config.Tables.Add(table); Services.TryAddScoped(typeof(TRepository)); @@ -36,7 +36,7 @@ public class HopFrameConfigurator(HopFrameConfig config, IServiceCollection serv /// The configurator for the table /// The model of the table /// Is thrown when configuration validation fails - public HopFrameConfigurator AddTable(TableConfig config, Action>? configurator = null) where TModel : notnull { + public HopFrameConfigurator AddTable(TableConfig config, Action>? configurator = null) where TModel : class { if (typeof(TModel) != config.TableType) throw new ArgumentException($"Table type for table '{config.Identifier}' does not mach requested type '{typeof(TModel).Name}'!"); diff --git a/src/HopFrame.Core/Configurators/PropertyConfigurator.cs b/src/HopFrame.Core/Configurators/PropertyConfigurator.cs index d22d1e1..c370fe2 100644 --- a/src/HopFrame.Core/Configurators/PropertyConfigurator.cs +++ b/src/HopFrame.Core/Configurators/PropertyConfigurator.cs @@ -2,50 +2,50 @@ namespace HopFrame.Core.Configurators; -/** - * The configurator for the - */ +/// +/// The configurator for the +/// public class PropertyConfigurator(PropertyConfig config) { - /** The internal config that is modified */ + /// The internal config that is modified public PropertyConfig Config { get; } = config; - /** */ + /// public PropertyConfigurator SetDisplayName(string displayName) { Config.DisplayName = displayName; return this; } - /** */ + /// public PropertyConfigurator Listable(bool listable) { Config.Listable = listable; return this; } - /** */ + /// public PropertyConfigurator Sortable(bool sortable) { Config.Sortable = sortable; return this; } - /** */ + /// public PropertyConfigurator Searchable(bool searchable) { Config.Searchable = searchable; return this; } - /** */ + /// public PropertyConfigurator Editable(bool editable) { Config.Editable = editable; return this; } - /** */ + /// public PropertyConfigurator Creatable(bool creatable) { Config.Creatable = creatable; return this; } - /** */ + /// public PropertyConfigurator SetOrderIndex(int index) { Config.OrderIndex = index; return this; diff --git a/src/HopFrame.Core/Configurators/TableConfigurator.cs b/src/HopFrame.Core/Configurators/TableConfigurator.cs index f492dd9..2edda3c 100644 --- a/src/HopFrame.Core/Configurators/TableConfigurator.cs +++ b/src/HopFrame.Core/Configurators/TableConfigurator.cs @@ -4,38 +4,38 @@ using HopFrame.Core.Helpers; namespace HopFrame.Core.Configurators; -/** - * The configurator for the - */ -public class TableConfigurator(TableConfig config) where TModel : notnull { - /** The internal config that is modified */ +/// +/// The configurator for the +/// +public class TableConfigurator(TableConfig config) where TModel : class { + /// The internal config that is modified public TableConfig Config { get; } = config; - /** */ + /// public TableConfigurator SetRoute(string route) { Config.Route = route; return this; } - /** */ + /// public TableConfigurator SetDisplayName(string displayName) { Config.DisplayName = displayName; return this; } - /** */ + /// public TableConfigurator SetDescription(string description) { Config.Description = description; return this; } - /** */ + /// public TableConfigurator SetOrderIndex(int index) { Config.OrderIndex = index; return this; } - /** Returns the configurator for a property */ + /// Returns the configurator for a property public PropertyConfigurator Property(string identifier) { var prop = Config.Properties .FirstOrDefault(p => p.Identifier == identifier); @@ -46,7 +46,7 @@ public class TableConfigurator(TableConfig config) where TModel : notnul return new PropertyConfigurator(prop); } - /** */ + /// public PropertyConfigurator Property(Expression> propertyExpression) { var propertyName = ExpressionHelper.GetPropertyInfo(propertyExpression).Name; var prop = Config.Properties.FirstOrDefault(p => p.Identifier == propertyName); diff --git a/src/HopFrame.Core/EFCore/HopFrameConfiguratorExtensions.cs b/src/HopFrame.Core/EFCore/HopFrameConfiguratorExtensions.cs index 8f5754d..894f8d9 100644 --- a/src/HopFrame.Core/EFCore/HopFrameConfiguratorExtensions.cs +++ b/src/HopFrame.Core/EFCore/HopFrameConfiguratorExtensions.cs @@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore; namespace HopFrame.Core.EFCore; -/** Adds useful extensions to the to add managed repositories */ +/// Adds useful extensions to the to add managed repositories public static class HopFrameConfiguratorExtensions { /// diff --git a/src/HopFrame.Core/Repositories/HopFrameRepository.cs b/src/HopFrame.Core/Repositories/HopFrameRepository.cs index db35cf9..1cc61c8 100644 --- a/src/HopFrame.Core/Repositories/HopFrameRepository.cs +++ b/src/HopFrame.Core/Repositories/HopFrameRepository.cs @@ -2,48 +2,48 @@ namespace HopFrame.Core.Repositories; -/** The base repository that provides access to the model dataset */ +/// The base repository that provides access to the model dataset public abstract class HopFrameRepository : IHopFrameRepository where TModel : class { - /** */ + /// public abstract Task> LoadPageAsync(int page, int perPage, CancellationToken ct = default); - /** */ + /// public abstract Task CountAsync(CancellationToken ct = default); - /** */ + /// public abstract Task> SearchAsync(string searchTerm, int page, int perPage, CancellationToken ct = default); - /** */ + /// public abstract Task CreateAsync(TModel entry, CancellationToken ct = default); - /** */ + /// public abstract Task UpdateAsync(TModel entry, CancellationToken ct = default); - /** */ + /// public abstract Task DeleteAsync(TModel entry, CancellationToken ct = default); - /** */ + /// public async Task LoadPageGenericAsync(int page, int perPage, CancellationToken ct) { return await LoadPageAsync(page, perPage, ct); } - /** */ + /// public async Task SearchGenericAsync(string searchTerm, int page, int perPage, CancellationToken ct) { return await SearchAsync(searchTerm, page, perPage, ct); } - /** */ + /// public Task CreateGenericAsync(object entry, CancellationToken ct) { return CreateAsync((TModel)entry, ct); } - /** */ + /// public Task UpdateGenericAsync(object entry, CancellationToken ct) { return UpdateAsync((TModel)entry, ct); } - /** */ + /// public Task DeleteGenericAsync(object entry, CancellationToken ct) { return DeleteAsync((TModel)entry, ct); } diff --git a/src/HopFrame.Core/Repositories/IHopFrameRepository.cs b/src/HopFrame.Core/Repositories/IHopFrameRepository.cs index 9ff8460..69db054 100644 --- a/src/HopFrame.Core/Repositories/IHopFrameRepository.cs +++ b/src/HopFrame.Core/Repositories/IHopFrameRepository.cs @@ -3,7 +3,7 @@ #pragma warning disable CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) namespace HopFrame.Core.Repositories; -/** The generic repository that provides access to the model dataset */ +/// The generic repository that provides access to the model dataset public interface IHopFrameRepository { /// diff --git a/src/HopFrame.Core/ServiceCollectionExtensions.cs b/src/HopFrame.Core/ServiceCollectionExtensions.cs index 033ffaf..fe03b3e 100644 --- a/src/HopFrame.Core/ServiceCollectionExtensions.cs +++ b/src/HopFrame.Core/ServiceCollectionExtensions.cs @@ -6,10 +6,10 @@ using Microsoft.Extensions.DependencyInjection; namespace HopFrame.Core; -/** An extension class to provide access to the setup of the library */ +/// An extension class to provide access to the setup of the library public static class ServiceCollectionExtensions { - /** Configures the library using the provided configurator */ + /// Configures the library using the provided configurator public static void AddHopFrame(this IServiceCollection services, Action configurator) { var config = new HopFrameConfig(); services.AddSingleton(config); diff --git a/src/HopFrame.Core/Services/IConfigAccessor.cs b/src/HopFrame.Core/Services/IConfigAccessor.cs index 42b027d..b627440 100644 --- a/src/HopFrame.Core/Services/IConfigAccessor.cs +++ b/src/HopFrame.Core/Services/IConfigAccessor.cs @@ -3,7 +3,7 @@ using HopFrame.Core.Repositories; namespace HopFrame.Core.Services; -/** A service used to access configs and repositories provided by the */ +/// A service used to access configs and repositories provided by the public interface IConfigAccessor { ///