mttmccb / DapperSW

Demo for .NET South West

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dapper Demo for .NET South West

I've just use the yeoman generator for ASP.NET Core to get a simple web application.

I added 3 dependencies

  • Dapper
  • Dapper.FluentMap (for additional mapping options)
  • Npgsql (for postgres)

I'm using a postgres database I grabbed from the pgfoundry called paglia, which is a database for a film. rental service.

To support this I've added Models, ViewModels, a Controller and a few Views to display a basic master/details page to show different ways to use Dapper.

Finally I've added config for Dapper.FluentMap to support some other kinds of mappings.

This application consists of

  • Sample pages using ASP.NET Core MVC
  • Bower for managing client-side libraries
  • Theming using Semantic UI

Semantic UI

CSS / JS

This generator uses the Semantic UI bower package. By default it includes the entire Semantic UI .css or .min.css depending on the environment. You can read the Semantic UI documentation here to learn how to use just the components you need.

Validation

In order for Semantic UI validation to play nicely with the jQuery unobtrusive validation, a helper has been added to hook into the validation calls and update the fields. This module simply highlights the field, and displays a validation summary.

For a form to be validated, add the validate-me class. To display the error messages use:

<div asp-validation-summary="All" class="ui error message"></div>

semantic.validation.js is where the magic happens. Upon error (highlight), find the nearest field element and add the error class. When the error is cleared (unhighlight), remove the error class from the nearest field element.

MenuLinkTagHelper

To assist with menu highlighting depending on the route, a MenuLinkTagHelper class has been included.

How to

Overview

Run & Deploy

We would love to hear your feedback

About

Demo for .NET South West


Languages

Language:JavaScript 53.8%Language:CSS 42.8%Language:HTML 2.9%Language:C# 0.5%