Skip to content

.net + MongoDB = ❤. An elegant, modern, easy, content oriented CMS

License

Notifications You must be signed in to change notification settings

Our-Company-Ltd/our.cms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Our CMS : .net + MongoDB = ❤

You can get the latest stable release from the official Nuget.org feed or from our github releases page.

Supported Platforms

Installation

Install nuget

Download via Nuget on Package Manager Console:

PM> Install-Package our.cms

Add to your app

using our.cms;
public void ConfigureServices(IServiceCollection services)
{
  …
  services.AddOurCMS();}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ...
{
  …
  app.UseOurCMS();}

Getting Started

Step 1: Create Model

using our.cms;
[Root]
[ParentOf(typeof(Child))]
public class Root : CmsEntry
{
}

public class Child : CmsEntry
{
  [Text]
  public string Title { get; set; }
  
  [HTML]
  public string Content { get; set; }
}

Step 2: Use Data

using our.cms;
public class HomeController : Controller
{
  
  protected readonly DB DB;
  
  // inject the database provider using D.I.
  public HomeController(IDBProvider dbprovider) {
    // gets the database
    DB = dbprovider.Default;
  }public IActionResult Index()
  {
    
    var child = DB.Find<Child>().FirstOrDefault();
    
    ViewData["Title"] = child?.Title ?? "no child !";
    ViewData["Content"] = child?.Content ?? "";
    
    return View();
  }}

About

.net + MongoDB = ❤. An elegant, modern, easy, content oriented CMS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published