AngelORM 1.1.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package AngelORM --version 1.1.4
NuGet\Install-Package AngelORM -Version 1.1.4
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="AngelORM" Version="1.1.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AngelORM --version 1.1.4
#r "nuget: AngelORM, 1.1.4"
#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.
// Install AngelORM as a Cake Addin
#addin nuget:?package=AngelORM&version=1.1.4

// Install AngelORM as a Cake Tool
#tool nuget:?package=AngelORM&version=1.1.4

Build status AppVeyor tests (compact) Nuget GitHub

LOGO

Angel ORM

Basic and lightweight mssql operations framework.

Why Angel ORM instead of Entity Framework?

  • Lightweight
  • Less exception
  • Customizable
  • Working with all model classes (does not require migration or anything)

Fetaures

  • Select: Get data as model list.
  • Where: Get data with expression conditions.
  • OrderBy: Get ordered data (also multiple and descending combinations avaible).
  • Insert: Insert new data to database.
  • Key: Inserted key feedback to model.
  • Update: Update row with auto detected key.
  • Delete: Delete row with auto detected key.
  • Transaction: Begin, Commit and Rollback transaction.
  • Raw Query: Get raw query as string or execute raw query on database.
  • Nullable Column: Supports for Nullable<T> type column (ex: public DateTime? ModifiedDate { get; set; })
  • Enum Column: Supports for Enum type column (ex: public MyTypeStatus Status { get; set; })
  • Created Query Feedback: You can use or manupilate created query with OnQueryExecuting method before execute.

Roadmap

  • Implement data annotations to define table and column names.
  • Add CreateTable<T>, CreateTableIfNotExists<T> and MigrateTable<T> methods to Engine.
  • Validate model fetaure from data annotations on Insert and Update.

Usage

Easy to use. You can do anything with one line 😊

SELECT

Engine engine = new Engine(connectionString);

List<User> users = engine.Select<User>().ToList();

WHERE

Engine engine = new Engine(connectionString);

List<User> users = engine.Select<User>().Where(x => x.Id > 5 && x.Role == "admin" && x.CreatedDate < dateTime && x.Active == true).ToList();
List<User> users = engine.Select<User>().Where(x => x.Name.Contains("foo")).ToList();
List<User> users = engine.Select<User>().Where(x => x.Name.StartsWith("foo")).ToList();
List<User> users = engine.Select<User>().Where(x => x.Name.EndsWith("foo")).ToList();

int[] refs = new int[] { 1, 2, 3, 4, 5 };

List<User> users = engine.Select<User>().Where(x => refs.Contains(x.Id)).ToList();

OrderBy and OrderByDescending

Engine engine = new Engine(connectionString);

List<User> users = engine.Select<User>().OrderBy(x => x.Name).ToList();
List<User> users = engine.Select<User>().OrderBy(x => x.Name).OrderByDescending(x => x.Surname).ToList();

INSERT

You can get inserted id after call insert method.

Engine engine = new Engine(connectionString);

engine.Insert(model);
int insertedId = model.Id;

UPDATE

Engine engine = new Engine(connectionString);

int affectedRows = engine.Update(model);

DELETE

Engine engine = new Engine(connectionString);

int affectedRows = engine.Delete(model);

TRANSACTIONS

Engine engine = new Engine(connectionString);

using (Transaction transaction = engine.BeginTransaction())
{
    try
    {
        engine.Insert(foo);
        engine.Update(bar);
        engine.Delete(baz);

        transaction.Commit();
    }
    catch (Exception ex)
    {
        transaction.Rollback();

        Log(ex);
    }
}

Raw Query

Engine engine = new Engine(connectionString);

string query = engine.Selet<User>().Where(x => x.Name == "foo").OrderBy(x => x.CreatedDate).ToSQL();

engine.ExecuteNonQuery(query);

Created Query Feedback

Engine engine = new Engine(connectionString);

List<User> users = engine
    .Select<User>()
    .OnQueryExecutin(x => x + " WHERE Id << 5 <> 0")
    .ToList();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 423 1/4/2021
1.1.4 655 7/11/2019