DEV Community

Robertblazor
Robertblazor

Posted on

Finishing up classlib project

Now, we covered the major part of how the class library project should be, let's be more aggressive.

Every model we have, we have a cs file linking to the collection, and we also have a DbConnection cs file.

Extract interface for everyone of them cover all of the actions, just in case some day we want to switch to a different database.

Add the global usings file to wrap up.

global using MongoDB.Driver;
global using MongoDB.Bson;
global using MongoDB.Bson.Serialization.Attributes;
global using Microsoft.Extensions.Caching.Memory;
global using Microsoft.Extensions.Configuration;
global using ThreadsLib.Models;
global using ThreadsLib.DataAccess;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay