Coder Social home page Coder Social logo

azuregems's Introduction

AzureGems

Summary of all the AzureGems libraries. For more detailed information check out the libraries individually.

AzureGems.CosmosDB

View Code

Library for getting started with Cosmos DB quickly and easily.

  • Simple connection config
  • Define DB Container properties:
    • model type
    • container name
    • throughput
    • partition key path
    • and more...

For example the following code can be added to your .NET/ASP.NET Core Startup.cs file to connect to Cosmos DB and ensure that the required containers are created/exists in the database:

services.AddCosmosDb(builder =>
{
	builder
		.Connect(endPoint: "<YOUR COSMOS DB ENDPOINT>", authKey: "<YOUR COSMOSDB AUTHKEY>")
		.UseDatabase(databaseId: "MyDatabase")
		.WithSharedThroughput(10000);
		.WithContainerConfig(c =>
		{
			c.AddContainer<Vehicle>(containerId: "Cars", partitionKeyPath: "/brand", queryByDiscriminator: false, throughput: 20000);
			c.AddContainer<Receipt>(containerId: "Receipts", partitionKeyPath: "/id");
			c.AddContainer<Accessory>(containerId: "Accessories", partitionKeyPath: "/category");
		});
});

AzureGems.Repository.Abstractions

View Code

Interface for a generic Repository Pattern.

Sample implementation: AzureGems.Repository.CosmosDB

AzureGems.Repository.CosmosDB

View Code

Cosmos DB specific implementation of the generic Repository Pattern. CosmosDbContainerRepository.cs implements the IRepository<T> interface.

This library also aims to provide EFCore-like DbContext's by simply declaring one or more IRepository<T> (DbSet in EFCore) inside a CosmosContext class.

For example:

public class LittleNorthwindCosmosContext : CosmosContext
{
    public IRepository<Customer> Customers { get; set; }
    public IRepository<Order> Orders { get; set; }
    public IRepository<Invoice> Invoices { get; set; }
}

The CosmosDbContainer implementation already contains the definition of each container (see AzureGems.CosmosDB) and can instantiate the IRepository<T> instances via reflection when the CosmosContext is resolved from the ServiceCollection.

The instance of your CosmosContext can now be used in your application's services or controllers by constructor injection.

AzureGems.SpendOps.Abstractions

View Code

Interfaces necessary for implementing #SpendOps into your ORM/Data Layers and Test Libraries.

Sample implementation using Cosmos DB: AzureGems.SpendOps.CosmosDB

AzureGems.SpendOps.CosmosDB

View Code

Cosmos DB implementations for IChargeTracker and ISpendTestChargeTracker.

The TrackedCosmosDbContainer collects RequestCharge values from all the CosmosDbResponse<T> objects returned from the CRUD operations performed by the CosmosDbContainer implementation.

Implementations of IChargeTracker and ISpendTestChargeTracker are configured in the Composition Root for your Application or Test Library.

For applications an implementation of IChargeTracker is used.

For unit/integration/spend tests an implementation of ISpendTestChargeTracker is configured and registered.

AzureGems.SpendOps.CosmosDB.ChargeTrackers.TableStorage

View Code

Charge Tracker using Azure Table Storage for persisting #SpendOps data.

AzureGems.SpendOps.CosmosDB.ChargeTrackers.CosmosDB

View Code

Charge Tracker using Azure Cosmos DB for persisting #SpendOps data.

TODO: Finish Code

AzureGems.MediatR.Extensions

View Code

Simple but useful extensions for MediatR

  • Specializes IRequest into IQuery and ICommand
  • Specializes IRequestHandler into IQueryHandler and ICommandHandler

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.