Lighter.NET 1.13.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Lighter.NET --version 1.13.3
                    
NuGet\Install-Package Lighter.NET -Version 1.13.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lighter.NET" Version="1.13.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lighter.NET" Version="1.13.3" />
                    
Directory.Packages.props
<PackageReference Include="Lighter.NET" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lighter.NET --version 1.13.3
                    
#r "nuget: Lighter.NET, 1.13.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lighter.NET@1.13.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lighter.NET&version=1.13.3
                    
Install as a Cake Addin
#tool nuget:?package=Lighter.NET&version=1.13.3
                    
Install as a Cake Tool

Lighter.NET is a tiny innovative library to improve the developemnt of asp.net core application including front-end and back-end works. This project aims to make more sense to the current asp.net core application development. The Lighter.NET is intended to be used together with Lighter.NET.DB nuget package which provides a light-weighted ORM utilizing EntityFramework 6.4.4 but more simplified.

With Lighter.NET, you can:

  1. Say Goodbye to the notorious ViewData and ViewBag.
  2. Say Goodby to the long-winded Entity Data Model file structures, such as *.edmx, *.Context.tt, *.Designer.cs, and unecessary DbSet for db table mapping.
  3. Say Goodbye to ever changing HtmlHelper or TagHelper as .NET version rapidly increasing.
  4. Say Hello to a more clean, concise and elegant front-end and back-end coding style.
  5. Say Hello to a more efficient localization mechanism with CompositeLocalizer.
  6. Say Goodbye to jQuery.
  7. Say Goodbye to Bootstrap.

The main features include:

  1. A ViewModelWrapper for delivering multiple models in a strong type manner between controller and view.
  2. A set of UiComponents for composing and rendering most frequently used html element in an efficient and consistent coding style across different .net version.
  3. To be used together with Lighter.NET.DB nuget package which provides a light-weighted ORM utilizing EntityFramework 6.4.4 but more simplified.
  4. A set of javascript library for client side DOM operations, AJAX oprerations, UI components such as DatePicker, PagingBar, AutoComplete, PopView, Panel, etc. and other client side routine UI interactions.
  5. A light-weight responsive css framework for responsive design.
  6. Some other helpers to simplify common application development works.

Release Notes Ver. 1.14.0 1. New: A new StringFormatAttribute to specify how the property value of an data model should be formatted when converted to string, including the format, text for null, text for boolean value and whether the formatted string should be html encoded or not. 2. New: A new TextTemplate class which can parse a text template which contains variable placeholders and then populate or subsitiute the template with variable values from a data model. 3. Fix: The rendering bug of UiComponent.Label which does no render the css class properly.

Ver. 1.13.2 1. Fix: The rendering bug for the RowCommand button visibility of TableOfT.

Ver. 1.13.1 1. Enhance: The RowCommandOfT now can be rendered as a different HTML element other than button by setting the new TagName property. 2. Enhance: The properties of RowCommandOfT now can be changed prior to its rendering according to the data model of the table row. This is achieved by setting the new Preprocessor property.

Ver. 1.13.0 1. New: A new MonthlyCalendar class to represent the monthly view of a gregorian calendar which can be set to arbitrary year and month. 2. Add: A serial of DateTime extension methods to get relative datetime to a specified datetime, including IsWeekend(), IsWeekday(), ClosestAfterWeekday(), ClosestBeforeWeekday(), NextWeekDay(), PreviousWeekDay(), NextWeek(), PreviousWeek(), FirstDateOfTheMonth(), LastDateOfTheMonth(), FirstDateOfTheYear(), LastDateOfTheYear(), EndOfDateTime(), NextDateTime(), PreviousDateTime(), NextDate(), PreviousDate(), WeekdayName(). 3. Change: The YearMonth.Parse() is changed from instance method to static method and please take a note that modification may be required for exsiting codes. 4. Obsolete: The YearMonth.Valid and YearMonth.State properties are absoleted and any invalid year and month value will throw an exception since these version. 5. Obsolete: The YearMonth.FromString() static method is obsoleted. Use the YearMonth.Parse() static method instead.

Ver. 1.12.7 1. Enhance: The return type of ReflectOnce.Bind() method is changed from void to ReflectOnce for better usability.

Ver. 1.12.6 1. Add: A new ReflectOnce class which is used as a wrapper class to do reflection once for the binding object and then providing the reflection related functionality multiple times for improving performance.

Ver. 1.12.5 1. Add: MessageModel.IsHtml property to indicate whether the message content contains HTML. 2. Add: An DateTime.ToString() extension method to trim out the ending zero time digits after formatting.

Ver. 1.12.4 1. Fix: UiComponent.CheckBox shows wrong checked state problom is fixed. A new ValueType property is added to classify the value CheckBox into Boolean (default) or String type. When boolean type, the value of CheckBox will always be "true". When string type, the Value property is used.

Ver. 1.12.3 1. New: StringLineBuilder which is a wrapper class of StringBuilder for providing additional LineCount, SpaceLineCount and NonSpaceLineCount properties and PrependLine() method.

Ver. 1.12.2 1. Add: (List of T).Add() extension method to add new item which is intialized using anonymous expression.

Ver. 1.12.1 1. Modified: The type of RowCommamnds property of UiComponents.TableOfT is changed from RowCommand to generic RowCommand of TDataModel to simplify the visibility and disabled state control for row command buttons. 2. Fix: UiComponent.PagingBar client mode behavior. 3. Add: UiComponent.Password to render input type="password" html tag. 4. Add: IUiElement.RenderHTML extension method to render tag expression of IHtmlContent on Razor page. 5. Add: (List of T).SetItem() extension method to set each item of list using anonymous expression.

Ver. 1.12.0 1. Add: Lighter.NET.Security.EncryptHelper for general encyption and decryption operations using DES and AES algorisms.

Ver. 1.11.3 1. Add: FormCommand.Keep, FormCommand.TempStore enum items.

Ver. 1.11.2 1. Add: FormCommand.Edit enum item. 2. Add: TypeExtension.SetValue() method to set class instance property value based on literal property name for some use case where the dot notation assignment is not applicable.

Ver. 1.11.1 1. Add: RowCommand.CommandVisible predicate property to dynamically control the visibility of command button in table row.

Ver. 1.11.0 1. Add: CheckBoxList, RadioButton, RadioButtonList in Lighter.NET.UiComponent. 2. Fix: fix the typo UiElementBase.WidthName to .WithName.

Ver. 1.10.1 1. Change: The cell text alignment css class is changed from center/left/right to text-center/text-left/text-right for UiComponents.TableOfT. 2. Add: ChangeListJsonArgumentName property of UiComponents.TableOfT which will be used as argument name when post the changed list json (after table editing) back to controller action.

Ver. 1.10.0 1. New YearMonth custom data type to deal with Year-Month data. 2. Adding Object.ToJson() extension method to convert object to json string which is commonly used as a client javascript variable value. 3. Adding Object.ToBase64() extension method to convert object to base64 string which is commonly used as a html data attribute value. 4. Adding TableOfT.ExcludeColumns() to exclude non-interested columns. 5. Fix the row number of TableOfT when paging is applied. 6. Fix some UiComponents that missing the style and other attributes when rendering html tag.

Ver. 1.9.1 1. New FilterDataName and FilterDataValue properties for Lighter.NET.Common.OptionItem for filtering interested options form a list of options. 2. The Lighter.NET.UiComponent.Select will render data-filter-filtername in its option tag so that client side javascript could utilize it to filter options. 3. EnumHelper.ConvertToOptionList now accepts an useEnumNameAsExtraData argument that will make the resulting Option item with enum name as extra option data.

Ver. 1.9.0 1. New CheckBoxEnabler property for TableOfT to conditionally enable or disable the row select checkbox based on the model state. 2. New CommandEnabler property for RowCommand to conditionally enable or disable the row command button based on the model state. 3. A data-datatype attribute is now rendered in the html tag for all UiComponents which would be useful for data model retrieval. 4. Bug fix for TypeExtension.IsNullableType(). 5. Critical Updates (which require modification of exsiting codes) for font-end lighter.js are listed below: (1) All function names from lighter.js now start with or renamed to (would impact exsiting codes) $ prefix like $SomeFunction() and this will be the naming convention for future lighter.js development. (2) All global variables or constants from lighter.js now start with $$ prefix like $$SomeVariable and this will be the naming convention for future lighter.js development. (3) The FetchJson() function is renamed to $Fetch() which would widely impact exsiting codes. (4) The ShowFetchJsonFailMessage() is renamed to $ShowFetchFailMessage() which would widely impact exsiting codes. 6. New $Plural() is introduced to lighter.js to simplify message wording for plural issue. 7. New $BadgeObject() and $LighterObject.badge() method provide the ability to add a badge label for information highlighting on the top-right corner of any visual DOM element. 8. New $PanelObject() is introduced to simplify the usage of Panel block as ui partial view.

Ver. 1.8.0 Add some FileHelper methods, such as Exists(), IsFile(), IsDirectory(), CanRead(), CanWrite(), ReverseReadLines() and ReverseReadBytes().

Ver. 1.7.1 1. Fix: Lighter.NET.UiComponent.TableOfT's column width for RowCommands column. 2. Enhancement for Lighter.NET.UiComponent.Label and LabelS to ensure the required star symbol being displayed in red color by using label-star css class.

Ver. 1.7.0 1. Lighter.NET.UiComponent.TableOfT now support header column grouping. 2. Updates of front-end lighter.js including following: (1) $TableObject now support header column groupping, reponsive column display mode and more table events including onRowAdd, onRowEdit, onFieldChanged, onSaveSuccess and onSaveFail. (2) $EventHub() enhancement for integration of custom and build-in events processing. (3) $ArrayUtilObject() now supports more array processing methods such as append, insert, remove, replace, etc..

Ver. 1.6.0

  1. Upgrading front-end lighter.js and lighter.css for followings: (1) Introducing a new $PopupView() factory funciton to make any html element (mainly form element) capable to popup as a modal view for user inputs. (2) Introducing Lighter Navbar to provide easy creation of navigation bar and menu items. (3) New $SlideIn() and $SlideOut() to achieve collapsing and expanding effect of any DOM element with or wrapping with .sliding-container css class. (4) New $Spinner() which accept a onCloseCallback to be executed when spinner is closed. (5) New onScrollOver(), onScrollToBottom(), onScrollToTop() event handler for $LighterObject for triggering callback when the target element is scrolled to specific height position. (6) The $LighterObject.autoComplete() introducing new arguments to support user input which is not included in the auto-complete list items.

Ver. 1.5.3 1. Add a ClientRowUpdateItem class to carry definition and row data to client end for patial table UI updating. 2. Add data-field-datatype and data-field-format attribute to the rendered thead >th tag of the TableOfT UiComponent to improve partial update capability for table rows. 3. Fix ApiResult constructor resulting with an empty Message problem.

Ver. 1.5.2 1. Enhancement for Lighter.NET.UiComponent.TableOfT, adding data-key-datatype attribute to rendered checkbox of row selection that would improve the model binding correctness when the selected key passed to controler action as json content-type. 2. A CombineObjects() utility function has been added to lighter.js which simply the combination of multiple objects or HTMLFormElements into single JS object which could be converted to json content-type to pass to server side. 3. Minor improvement for $TableObject and $PagingBarObject of lighter.js

Ver. 1.5.1 1. The TableOfT UiComponent has a new CheckBoxForAll property which determines whether to show a checkbox on the header column to check or uncheck all rows. 2. The TableOfT UiComponent has a new ShowRowNo property which is intended to replace the AutoSerialNo property for better semantic. 3. Enhancement for front-end lighter.js for following: (1) A new $PopupFormObject has been introduced in the lighter.js to popup any HTMLElement mainly for HTMLFormElement in a showMoal() mode. (2) A new set of css style for Panel style content has been introduced in the lighter.css. (3) $TableObject will check for first and second columns for the existance of row selection checkbox. (4) The ConvertToFormData() function introduces a new includeExtraData argument which would include extra key-value pair from data-extra-name and data-extra-value attribute of SELECTED option into resulting FormData.

Ver. 1.5.0 1. Add: Lighter.NET.Helper.ApiHelper to simplify and ensure the best practice of the use of HttpClient, based on an HttpClientManager that controls the pooling of the underlining HttpHandlers. 2. Add: Lighter.NET.Helper.FormatHelper to simplify formating object form of primitive types. 3. Enhancement for Lighter.NET.UiComponents.TableOfT including following: (1) Add: new constructor with autoIncludeColumns argument would automatically add all TDataModel properties to Columns of the table. (2) Add: RowSelectByCheckBox property, an checkbox column will be added at the first column of the table when this property set true. (3) Add: UseCustomJsSubmitHandler property, if true then SubmitActionName could be optional and the submit action should be handled by client javascript handler function. 4. Enhancement for Lighter.NET.PagingSetting including following: (1) the PageCount, StartRowNo, EndRowNo has become automatically calculated from TotalRowCount and RowsPerPage. (2) Add: ShowRecordInfo proerty, a record information of the current data page (ex. Showing m to n of rowCount entries) will be shown when this property is set true. (3) Add: IsClientMode property, the paging bar will control the paging of the binding table totally in client side without needing to update the table rows and paging setting from server side when this property set true. 5. Add: ListOfTExtension.Filter(PagingSetting) method that enables and simplifies the paging opreration for List<T> data list. 6. Add: A generic Lighter.NET.Common.CacheStore features high performance, thread-safty and auto clean up for expired cached items. 7. Fix: Lighter.NET.Common.AcademicYear calculation of the Value property which could go wrong previously.

Ver. 1.4.0 1. Add $LighterObject.autoComplete() method in lighter.js. The autoComplete() features an onCompleteCallback to provide more sophisticated intercation to the matched option, a mustMatch flag to prevent arbitrary input and a support to synonyms lookup. 2. Remove ApiResultHelper 3. Remove DebugMessages from ApiResult 4. Add private _exceptions field and public AddException() and Exceptions() methods to ApiResult to make it capable deliver exception object out to the caller. In the mean while, avoid sensitive security information to be expose to client while doing json serialization. 5. Bug fix for ValidationHelper

Ver. 1.3.0 1. Introduce the $LighterObject to lighter.js for easy client ui element manipulation, such as visibility, style, parent and child element searching and event handling. 2. Introduce $ElementFlag and flag binding functionality to lighter.js which automatively triggers some ui interactive behavior according to target elements flag state. 3. Introduce an $StateMachine to lighter.js for general dynamic state management, such as client side table row editing and batch updating. 4. Introudec an $Map to lighter.js for easy client side dictionary lookup. 5. Adding ContentConverter property for Comlumn of T UiComponent to enhance table column flexibility, for example convert text to hyperlink. 6. Adding HideColumnHeader property for TableOfT UiComponent. 7. Adding CanAdd, CanDelete property for TableOfT, which also enable the data source model list to be combined with the client table object for better client row event handling ability. 8. Adding Step property for DatatimeLocal UiComponent. 9. Adding IsDisabled property for IUiElement. 10. Adding GetValue() extension method for all Class type which enables getting the property value by string of property name. 11. Fixing Column width problem for AutoSerialNo and RowCommnads columns. 12. Enhancement to lighter.css for better rwd effects and adding some ui component style like Step Bar Style.

Ver. 1.2.5 1. New FileHelper.FormatFilesize() to format filesize to GB, MB or KB. 2. Bug fix for ViewModelWrapper to avoid key conflict.

Ver. 1.2.4 Ver. 1.2.3 1. Enhancement of ViewModelWrapper for model value validation. 2. Improvement of UiElements including Date, DateTimeLocal and Label. 3. New UiElement of Month for year and month input. 4. Improvement of ValidationHelper.

Ver. 1.2.2 1. Add StateModel for change tracking of data record 2. Enhancement of LogModel and HttpRequestErrorLogModel for more reasonable and efficient logging information. 3. TableOfT UiComponent now support inline row editing and multiple rows editing and change tracking. 4. Enhancements for UiComponents including ColumnOfT, UiElementBase, Column, CheckBox, Date, DateTimeLocal, Number, Select, Text,TextArea.

Ver. 1.2.1 1. Resolving conflicked files.

Ver. 1.2.0 1. Reconstruct the ViewModelWrapper to inherit from BaseViewModel which can be used to communicate between View and Layout. 2. New PrivacyHelper for privacy protection functions. 3. New PercentWidth for defining width which support basic adding and substraction operation.

Ver. 1.1.0 1. Adding CompositeLocalizer which combining multiple localizers for DataAnnotation localization. 2. Adding javascript libraries and css to facilitate font-end responsive web development.

Ver. 1.0.0 First Release.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Lighter.NET:

Package Downloads
Lighter.NET.DB

Lighter.NET.DB is a Lightweight ORM data access layer utilizing Entity Framework 6.5.1. It aims to provide an easy to use and flexsible and more efficient db access experience for developer. With Lighter.NET.DB, you can seamlessly combine ORM and conventional SQL script coding style for data access operations in a concise and efficient manner. Moreover, you can say goodbye to the long-winded Entity Data Model file structures, such as *.edmx, *.Context.tt, *.Designer.cs, and unecessary DbSet for db table mapping. It features the followings: 1. Full select, insert, update, delete support using ORM approach, as well as using conventional SQL script approach. 2. Easy data paging for select result set or even for mass insert or update. 3. Automatic logging for update and delete operation. 4. Simpify the transactional db operations that eliminates all the boilerplate code of using tranaction, try...catch, commit when success and rollback when failure. 5. Auto increment column and Sequence support. 6. A full-featured where condition builder which is easy to use and significanly simplify the complexity when multiple optional filter columns are involved. 7. An improved DbContext dispose mechanism which based on the "Always dispose after usage unless explicitly declaring for reuse" policy.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.18.0 149 2/4/2026
1.17.3 126 1/19/2026
1.17.2 353 12/18/2025
1.17.1 495 12/10/2025
1.17.0 242 10/30/2025
1.16.3 308 3/10/2025
1.16.2 264 3/10/2025
1.16.1 326 3/4/2025
1.16.0 200 1/24/2025
1.15.1 196 1/8/2025
1.15.0 207 1/8/2025
1.14.0 215 10/21/2024
1.13.3 191 10/21/2024
1.13.2 185 10/17/2024
1.13.1 208 10/16/2024
1.13.0 202 10/13/2024
1.12.7 199 10/7/2024
1.12.6 204 10/7/2024
1.12.5 206 9/27/2024
1.12.4 243 9/16/2024
Loading failed

1. New: A new StringFormatAttribute to specify how the property value of an data model should be formatted when converted to string, including the format, text for null, text for boolean value and whether the formatted string should be html encoded or not.
2. New: A new TextTemplate class which can parse a text template which contains variable placeholders and then populate or subsitiute the template with variable values from a data model.
3. Fix: The rendering bug of UiComponent.Label which does no render the css class properly.