Skip to content

HLinteractive/hli.core

Repository files navigation

HL Interactive

HL Interactive (HLi)

Table of contents generated with markdown-toc

HLI.Core

ModelBase class and other common C# code.

NuGet Downloads Build Status VSTS

Usage

Installation

Download the nuget package through Package Manager Console:

install-package HLI.Core

You can also clone the package on GitHub:

Model Base

For business objects / models; inherit one of the base classes:

  • ModelBase - inherits AuditedObject and implements change tracking, notification, filtering. This gives a complete model with little effort. Inherits all of the below.
  • AuditedObject - IObjectWithAudit implementation that inherits EditableObject. Provides base properties
    • Created:DateTime
    • Updated:DateTime
    • Version:int
    • Id:Guid
  • NotificationObject: INotifyPropertyChanged implementation with SetProperty methods
  • EditableObject - IEditableObject implementation allowing change tracking by calling BeginEdit, CancelEdit and EndEdit

Extensions

Common portable extensions to avoid code copy (i.e re-inventing the wheel).

  • EnumerableExtensions - IndexOf method accepting an object
  • ExpressionExtensions - ToPropertyName method acccepting an Expression
  • ObjectExtensions - provides the following methods:
    • StreamToByte accepting an Stream
    • DeepClone accepting an object
    • GetValueForProperty accepting a property name by string or Expression

Other

Other nifty code to keep you going:

  • DateTimeSpan - because it's missing from .Net

Delivery & Deployment

Download the nuget package through Package Manager Console:

install-package HLI.Forms.Core

Dependencies

  • Projects
  • Packages
    • Newtonsoft.Json
  • Tools
    • Windows 8.1 SDK
    • Windows 10 SDK

NuGet Package Generation

The project is configured to automatically generate a *.nupkg upon build using Visual Studio 2017 CsProj MSBuild.

Solution File Structure

  • HLI.Core - solution root directory
    • HLI.Core (Portable) - main project
      • Extensions - common extensions to .Net classes
      • Interfaces - interfaces used by project
        • Models - model interfaces
        • Repositories - repository pattern interfaces
      • Models - base models to simplify validation, serialization, change tracking etc.
    • HLI.Core.Tests - unit tests (MS Test)
      • Mocks

Releases

No releases published

Packages

No packages published

Languages