SP1 1.0.8
dotnet add package SP1 --version 1.0.8
NuGet\Install-Package SP1 -Version 1.0.8
<PackageReference Include="SP1" Version="1.0.8" />
<PackageVersion Include="SP1" Version="1.0.8" />
<PackageReference Include="SP1" />
paket add SP1 --version 1.0.8
#r "nuget: SP1, 1.0.8"
#:package SP1@1.0.8
#addin nuget:?package=SP1&version=1.0.8
#tool nuget:?package=SP1&version=1.0.8
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>)
- List pages (
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
CrudContextFlexible integration with providers:
IDatabaseProviderIAccessControlProviderIUIProvider
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 accessIAccessControlProvider— access control managementIUIProvider— 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:
IDatabaseProviderIAccessControlProviderIUIProvider
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 | Versions 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. |
-
net9.0-android35.0
- QuestPDF (>= 2025.7.4)
- QuestPDF.Markdown (>= 1.42.0)
- sqlite-net-pcl (>= 1.9.172)
-
net9.0-ios18.0
- QuestPDF (>= 2025.7.4)
- QuestPDF.Markdown (>= 1.42.0)
- sqlite-net-pcl (>= 1.9.172)
-
net9.0-maccatalyst18.0
- QuestPDF (>= 2025.7.4)
- QuestPDF.Markdown (>= 1.42.0)
- sqlite-net-pcl (>= 1.9.172)
-
net9.0-windows10.0.19041
- QuestPDF (>= 2025.7.4)
- QuestPDF.Markdown (>= 1.42.0)
- sqlite-net-pcl (>= 1.9.172)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.