Skip to content
Daniel Porrey edited this page May 24, 2020 · 10 revisions

GitHub Build Status

RazorTools

The Razor Tools library is designed to wrap JavaScript and JQuery objects into C# methods. Objects can be easily added to Razor views with basic C# code. All objects are created and initialized using unobtrusive JavaScript techniques and fluent API. This allows complex objects to be created within your views with simple C# statements.

Dependencies

The current version of these libraries are built for .NET Core with dependencies on netstandard2.1, netcoreapp3.1 and Microsoft.AspNetCore.Mvc.ViewFeatures.

Concept

The basic concept of RazorTools is to provide fluent APIs to create JQuery and JavScript objects in Razor views. Syntax such as

@(Create<FancyObject>().WithStyle(Style.Cool).UsingData("Home", "Data"))

can be used to generate complex objects that interact with the controller to retrieve data while keeping the view code clean and straight forward. In some cases, objects can also be render using simple statements such as

@Html.RenderObject(new FancyObject("fancyObject123")
{
	DataUrl = this.Url.Action("Home", "Data")
})

Base Object

Nuget Nuget

This library provides the base class for all RazorTools objects. It provides the basic code for building tags and embedding them in Razor views. All of the RazorTools packages will be based on this library. Generally, you will not add this library directly to your project.

Charts

Nuget Nuget

Overview

Create simple charts in your Razor views. This library wraps morris.js charts along with some other tools to produce nice looking charts.

Install

To install use the .NET CLI

>dotnet add package Mvc.RazorTools.Charts

or Package manager

PM>Install-Package Mvc.RazorTools.Charts

Documentation

For more information see the documentation in the repo Wiki pages: RazorTools - Charts documentation.

Font Awesome

Nuget Nuget

Overview

Use Font Awesome icons in your views with a fluent API. Reference your Font Awesome package or download and install the files locally.

Install

To install use the .NET CLI

>dotnet add package Mvc.RazorTools.FontAwesome

or Package manager

PM>Install-Package Mvc.RazorTools.FontAwesome

Documentation

For more information see the documentation in the repo Wiki pages: RazorTools - Font Awesome documentation.