Add basic blog repo and models to test potential project structure
This commit is contained in:
parent
7703f9d8bb
commit
19c3c49f4d
10 changed files with 91 additions and 3 deletions
|
@ -9,6 +9,7 @@ using Microsoft.AspNetCore.HttpsPolicy;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Website.Data;
|
||||
|
||||
namespace Website
|
||||
{
|
||||
|
@ -31,10 +32,16 @@ namespace Website
|
|||
options.MinimumSameSitePolicy = SameSiteMode.None;
|
||||
});
|
||||
|
||||
services.AddSingleton<IConfiguration>(Configuration);
|
||||
RegisterRepositories(services);
|
||||
|
||||
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
|
||||
}
|
||||
|
||||
private void RegisterRepositories(IServiceCollection services) =>
|
||||
services.AddSingleton<DatabaseProvider, DatabaseProvider>()
|
||||
.AddSingleton<BlogRepository, BlogRepository>();
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue