Skip to content

CloudStorageORM simplifies data persistence by using cloud storage (Azure, AWS, Google) as a scalable and reliable data source through Entity Framework. Built with .NET 8, Clean Architecture, and SOLID principles, it’s ideal for small to medium cloud-native applications.

License

Notifications You must be signed in to change notification settings

rzavalik/CloudStorageORM

Repository files navigation

CloudStorageORM

Simplify persistence. Embrace scalability. Build the future.

CloudStorageORM is a lightweight and powerful library that enables developers to use cloud storage (Azure Blob Storage, AWS S3, Google Cloud Storage) as a reliable and scalable data source through Entity Framework.
Built with .NET 8, following Clean Architecture and SOLID principles, it empowers small and medium applications to focus on business logic while reducing the complexity of managing traditional databases.

License .NET NuGet Build Status Build Status Contributing Security Policy

πŸ‘‰ See the full Roadmap


✨ Features

  • ☁️ Use Azure Blob Storage, AWS S3, or Google Cloud Storage as your database
  • πŸ› οΈ Builder Pattern and Clean Architecture ready
  • πŸ”₯ Full Unit Test coverage using xUnit, Shouldly, and Moq
  • πŸ”’ Optimized for scalability, reliability, and concurrency control
  • πŸ›† Available on NuGet for easy installation
  • 🎯 Built with .NET 8 and Entity Framework integration in mind

πŸ›† Installation

Install via CLI:

dotnet add package CloudStorageORM --version 1.0.7

Or search for CloudStorageORM in the NuGet Package Manager inside Visual Studio.


πŸš€ Getting Started

Start by configuring your cloud storage provider:

var options = new CloudStorageOptions
{
    Provider = CloudProvider.Azure,
    ConnectionString = "UseDevelopmentStorage=true",
    ContainerName = "sampleapp-container"
};

var storageProvider = new AzureBlobStorageProvider(options);
var context = new CloudStorageDbContext(options, storageProvider);
var users = await context.Set<User>().ToListAsync();

SampleApp

using CloudStorageORM.DbContext;
using CloudStorageORM.Enums;
using CloudStorageORM.Options;
using CloudStorageORM.StorageProviders;

var options = new CloudStorageOptions
{
    Provider = CloudProvider.Azure,
    ConnectionString = "UseDevelopmentStorage=true", // Azurite local emulator or real Azure
    ContainerName = "sampleapp-container"
};

var storageProvider = new AzureBlobStorageProvider(options);
var context = new CloudStorageDbContext(options, storageProvider);

var repository = context.Set<User>();
var userId = Guid.NewGuid().ToString();

// βž• Create
await repository.AddAsync(userId, new User
{
    Id = userId,
    Name = "John Doe",
    Email = "[email protected]"
});

// πŸ“ƒ List
var users = await repository.ListAsync();
foreach (var user in users)
{
    Console.WriteLine($"{user.Id}: {user.Name} ({user.Email})");
}

// ✏️ Update
var updatedUser = new User
{
    Id = userId,
    Name = "John Doe Updated",
    Email = "[email protected]"
};
await repository.UpdateAsync(userId, updatedUser);

// πŸ”Ž Find
var foundUser = await repository.FindAsync(userId);
Console.WriteLine($"Found: {foundUser?.Id} - {foundUser?.Name} ({foundUser?.Email})");

// πŸ—‘οΈ Delete
await repository.RemoveAsync(userId);

// πŸ“ƒ List after deletion
var usersAfterDelete = await repository.ListAsync();
Console.WriteLine($"Remaining users: {usersAfterDelete.Count}");

πŸ“š Full examples and extended documentation are coming soon!


πŸ§ͺ Running Tests Locally

CloudStorageORM uses Azurite to simulate Azure Blob Storage locally for unit testing.
See Testing with Azurite to configure your local environment.


πŸ›‘οΈ License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0-only).
Commercial use without prior authorization is not allowed.
See the LICENSE file for more information.


🀝 Contributing

We welcome contributions from the community! πŸš€
If you'd like to help, please read our Contributing Guidelines and Pull Request Template.

Thank you for helping make CloudStorageORM even better!


"CloudStorageORM empowers developers to move faster, scale smarter, and build stronger applications by leveraging the true power of cloud storage." πŸš€

About

CloudStorageORM simplifies data persistence by using cloud storage (Azure, AWS, Google) as a scalable and reliable data source through Entity Framework. Built with .NET 8, Clean Architecture, and SOLID principles, it’s ideal for small to medium cloud-native applications.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages