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)