SP1 1.0.8

dotnet add package SP1 --version 1.0.8
                    
NuGet\Install-Package SP1 -Version 1.0.8
                    
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="SP1" Version="1.0.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SP1" Version="1.0.8" />
                    
Directory.Packages.props
<PackageReference Include="SP1" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SP1 --version 1.0.8
                    
#r "nuget: SP1, 1.0.8"
                    
#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.
#:package SP1@1.0.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SP1&version=1.0.8
                    
Install as a Cake Addin
#tool nuget:?package=SP1&version=1.0.8
                    
Install as a Cake Tool

AutoGenCrudLib

Automatic CRUD Interface Generation for .NET MAUI Applications

AutoGenCrudLib is a lightweight library designed to automate the creation of CRUD (Create, Read, Update, Delete) interfaces and logic based on data models. It simplifies working with SQLite, MAUI Pages, and relationships between entities.


Features

  • Automatic generation of:

    • List pages (EntityListPage<T>)
    • Detail pages (EntityDetailPage<T>)
  • Attribute support:

    • [Foreign] — defines a foreign key
    • [ManyToMany] — defines a many-to-many relationship
    • [Freeze] — marks a field as read-only
  • Simplified record creation, editing, and deletion

  • Automatic database binding through CrudContext

  • Flexible integration with providers:

    • IDatabaseProvider
    • IAccessControlProvider
    • IUIProvider

Installation

dotnet add package SP1

Initialization

Before use, initialize the library context:

CrudContext.Init(
    database: new MyDatabaseProvider(),
    access: new MyAccessControlProvider(),
    ui: new MyUIProvider()
);

These providers implement the following interfaces:

  • IDatabaseProvider — database access
  • IAccessControlProvider — access control management
  • IUIProvider — user interaction (e.g., DisplayAlert, DisplayConfirm)

Attributes

[Foreign(Type foreign)]

Specifies a foreign key reference to another entity.

[Foreign(typeof(Category))]
public int CategoryId { get; set; }

In the UI, this field is automatically displayed as a Picker populated with values from the related table.


[Freeze]

Marks a field as read-only in the UI.

[Freeze]
public string Code { get; set; }

[ManyToMany(Type foreign)]

Defines a many-to-many relationship. Data is stored as a comma-separated string of IDs.

[ManyToMany(typeof(Tag))]
public string Tags { get; set; } = "";

You can work with such properties through extension methods:

var tags = post.GetManyToManyList<Tag>("Tags");
post.SetManyToManyList("Tags", selectedTags);

Pages

EntityListPage<T>

Displays a list of T entities with options to add, edit, and delete records.

await Navigation.PushAsync(new EntityListPage<Product>());

Buttons such as “Add,” “Delete,” and “Refresh” are automatically managed through the AccessControlProvider.


EntityDetailPage<T>

Automatically generates an editable form for entity T.

await Navigation.PushAsync(new EntityDetailPage<Product>(product));

Supports:

  • Text fields (string, double)
  • Enumerations (enum)
  • Foreign keys ([Foreign])
  • Read-only fields ([Freeze])

Many-to-Many Extensions

Located in the SP12.Model namespace:

entity.GetManyToManyList("Tags");
entity.SetManyToManyList("Tags", listOfTags);

These methods support both EntityBase and generic versions <T>.


Example Usage

public class Product : EntityBase
{
    [PrimaryKey, AutoIncrement]
    public int Id { get; set; }

    public string Name { get; set; }

    [Foreign(typeof(Category))]
    public int CategoryId { get; set; }

    [ManyToMany(typeof(Tag))]
    public string Tags { get; set; } = "";
}
// Open list page
await Navigation.PushAsync(new EntityListPage<Product>());

Project Structure

AutoGenCrudLib/
│
├── Attributes/
│   ├── ForeignAttribute.cs
│   ├── FreezeAttribute.cs
│   └── ManyToManyAttribute.cs
│
├── Views/
│   ├── EntityListPage.cs
│   ├── EntityDetailPage.cs
│   └── EntityListView.cs
│
├── CrudContext.cs
└── Models/ (extensions)

Dependencies

  • .NET MAUI

  • SQLite-net (via SQLiteAttribute)

  • Your custom provider implementations:

    • IDatabaseProvider
    • IAccessControlProvider
    • IUIProvider

License

GPLv3 License — This library is distributed under the terms of the GNU General Public License v3. If you distribute a project using this library, you are required to make your source code publicly available under the same license.

Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst18.0 is compatible.  net9.0-windows10.0.19041 is compatible.  net10.0-android was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-windows 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.0.8 399 11/20/2025
1.0.7 195 11/6/2025
1.0.6 196 11/6/2025
1.0.5 194 11/6/2025
1.0.4 190 11/5/2025
1.0.3 189 11/5/2025
1.0.2 196 11/4/2025
1.0.1 193 11/3/2025