AngelORM 1.1.4

AngelORM is a lightweight ORM that makes everything easy.

Install-Package AngelORM -Version 1.1.4
dotnet add package AngelORM --version 1.1.4
<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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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&lt;T&gt; 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 :blush:

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();

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&lt;T&gt; 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 :blush:

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();

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.4 116 7/11/2019