MiniORM 1.0.0
dotnet add package MiniORM --version 1.0.0
NuGet\Install-Package MiniORM -Version 1.0.0
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="MiniORM" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MiniORM" Version="1.0.0" />
<PackageReference Include="MiniORM" />
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 MiniORM --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MiniORM, 1.0.0"
#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 MiniORM@1.0.0
#: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=MiniORM&version=1.0.0
#tool nuget:?package=MiniORM&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MiniORM
MiniORM is a lightweight ORM (Object-Relational Mapper) for .NET applications, designed to simplify database interactions and reduce the amount of boilerplate code required for CRUD operations.
Installation
You can install MiniORM via NuGet Package Manager or .NET CLI.
Using NuGet Package Manager
- Open your project in Visual Studio.
- Right-click on the project in the Solution Explorer and select Manage NuGet Packages.
- Search for MiniORM.
- Click Install to add the package to your project.
Getting Started
Step 1: Configure Connection String
To use MiniORM, you need to set the connection string for your database. Use the SetConnectionString method to configure it.
using MiniORM;
public class Program
{
public static void Main(string[] args)
{
MiniORM<EntityType, Entity> orm = new MiniORM<EntityType, Entity>();
orm.SetConnectionString("YourConnectionStringHere");
// Example usage
orm.Insert(new Entity { /* set properties */ });
}
}
Step 2: Define Your Entities
Create your entity classes representing the tables in your database. Ensure that the class names match the table names, and the property names match the column names.
csharp
public class User
{
public int Id { get; set; }
public string Name { get; set; }
public List<Address> Addresses { get; set; }
}
public class Address
{
public int Id { get; set; }
public string Street { get; set; }
public string City { get; set; }
}
Step 3: Perform CRUD Operations
MiniORM supports basic CRUD operations.
Note:You Must have An 'Id' Propertey and you need to insert the Id manually.
Insert
csharp
User user = new User
{
Id = 1,
Name = "John Doe",
Addresses = new List<Address>
{
new Address { Street = "123 Main St", City = "Anytown" }
}
};
orm.Insert(user);
Read
csharp
List<User> users = orm.SelectAll<User>();
Update
csharp
user.Name = "Jane Doe";
orm.Update(user);
Delete
orm.Delete(user);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos 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.
-
net8.0
- Microsoft.Data.SqlClient (>= 5.2.1)
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.0 | 138 | 8/1/2024 |