GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jarroda/ServiceStack.OrmLite.Additions: Additional classes to enhance OrmLite functionality

This repository was archived by the owner on Jun 24, 2025. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.nuget
.nuget
 
 
ServiceStack.OrmLite.Additions
ServiceStack.OrmLite.Additions
 
 
.gitignore
.gitignore
 
 
Readme.md
Readme.md
 
 
ServiceStack.OrmLite.Additions.sln
ServiceStack.OrmLite.Additions.sln
 
 

Repository files navigation

ServiceStack.OrmLite.Additions Build status

This package adds useful functionality to OrmLite v3

Installation

Install the NuGet package

PM> Install-Package ServiceStack.OrmLite.Additions

ReliableSqlServerOrmLiteDialectProvider

This is an implementation of OrmLite's SqlServer Dialect Provider that utilizes transient fault handling. The connections created are instances of ReliableSqlConnection from the Enterprise Library's Transient Fault Handling Application Block.

To use, simply replace the regular SqlServer dialect provider with the reliable version when creating the OrmLiteConnectionFactory:

var factory = new OrmLiteConnectionFactory(connectionString, ReliableSqlServerOrmLiteDialectProvider.Instance);
container.Register<IDbConnectionFactory>(db);

OrmLiteConfigurator

The OrmLiteConfigurator is a static class that exposes OrmLite's internal Type -> ModelDefinition mapping. This allows insepction and modification of the model definition. Additionally, the OrmLiteConfigurator allows the configuration of OrmLite without using attributes on your domain models. This allows for model classes to reside in an assembly that does not, or can not have a reference to ServiceStack.OrmLite;

To access the mapping or get the ModelDefinition of a type:

var map = OrmLiteConfigurator.TypeModelDefinitionMap;
var definition = OrmLiteConfigurator.GetModelDefinition<MyModel>();

To configure a type in OrmLite, a fluent interface is provided. Most of OrmLite's features are exposed through the parameters to AddField, including foreign keys. This should only be done during application startup.

OrmLiteConfigurator.TypeModelDefinitionMap.AddModelDefinition<Project>("Projects")
    .AddField(p => p.Id, isPrimaryKey: true, isAutoIncrement: true)
    .AddField(p => p.ProjectName)
    .AddField(p => p.ProjectNumber, defaultValue: "100")
    .AddField(p => p.ProjectManagerId, references: typeof(User), onDelete: "CASCADE", onUpdate: "CASCADE")
    .AddIgnoredField(p => p.ProjectManagerEmail);

About

Additional classes to enhance OrmLite functionality

Resources

Readme
Activity

Stars

5 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.