Commit 961dd1b9 authored by boncho vylkov's avatar boncho vylkov

merge to master

parents 90c0c4da 10c4052f
using System;
using System.Collections.Generic;
using System.Text;
namespace MvcCoreTemplate.Services.Data
{
public class CommonService : ICommonService
{
public string TestService()
{
return "TestService";
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace MvcCoreTemplate.Services.Data
{
public interface ICommonService
{
string TestService();
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Threading.Tasks;
namespace MvcCoreTemplate.Web.Services
namespace MvcCoreTemplate.Services.Web
{
public interface IEmailSender
{
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Threading.Tasks;
namespace MvcCoreTemplate.Web.Services
namespace MvcCoreTemplate.Services.Web
{
public interface ISmsSender
{
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Threading.Tasks;
namespace MvcCoreTemplate.Web.Services
namespace MvcCoreTemplate.Services.Web
{
// This class is used by the application to send Email and SMS
// when you turn on two-factor authentication in ASP.NET Identity.
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
......@@ -9,10 +7,10 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using MvcCoreTemplate.Web.Models;
using MvcCoreTemplate.Web.Models.AccountViewModels;
using MvcCoreTemplate.Web.Services;
using MvcCoreTemplate.Models;
using MvcCoreTemplate.Services.Web;
namespace MvcCoreTemplate.Web.Controllers
{
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MvcCoreTemplate.Services.Data;
namespace MvcCoreTemplate.Web.Controllers
{
[Produces("application/json")]
[Route("api/BaseApi")]
public class BaseApiController : Controller
{
private ICommonService commonService;
public BaseApiController(ICommonService commonService)
{
this.commonService = commonService;
}
public string TestService()
{
return this.commonService.TestService();
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using MvcCoreTemplate.Services.Data;
namespace MvcCoreTemplate.Web.Controllers
{
public class BaseController : Controller
{
protected ICommonService commonService;
public BaseController(ICommonService commonService)
{
this.commonService = commonService;
}
}
}
\ No newline at end of file
......@@ -3,14 +3,20 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using MvcCoreTemplate.Services.Data;
namespace MvcCoreTemplate.Web.Controllers
{
public class HomeController : Controller
public class HomeController : BaseController
{
public HomeController(ICommonService commonService) : base(commonService)
{
}
public IActionResult Index()
{
return View();
var model = this.commonService.TestService();
return View("Index",model);
}
public IActionResult About()
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using MvcCoreTemplate.Web.Models;
using MvcCoreTemplate.Web.Models.ManageViewModels;
using MvcCoreTemplate.Web.Services;
using MvcCoreTemplate.Models;
using MvcCoreTemplate.Services.Web;
namespace MvcCoreTemplate.Web.Controllers
{
......
......@@ -51,8 +51,11 @@
<Folder Include="Data\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MvcCoreTemplate.Common\MvcCoreTemplate.Common.csproj" />
<ProjectReference Include="..\MvcCoreTemplate.Data\MvcCoreTemplate.Data.csproj" />
<ProjectReference Include="..\MvcCoreTemplate.Models\MvcCoreTemplate.Models.csproj" />
<ProjectReference Include="..\MvcCoreTemplate.Services.Data\MvcCoreTemplate.Services.Data.csproj" />
<ProjectReference Include="..\MvcCoreTemplate.Services.Web\MvcCoreTemplate.Services.Web.csproj" />
</ItemGroup>
</Project>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using MvcCoreTemplate.Web.Services;
using MvcCoreTemplate.Models;
using MvcCoreTemplate.Data;
using MvcCoreTemplate.Services.Web;
using MvcCoreTemplate.Services.Data;
namespace MvcCoreTemplate.Web
{
......@@ -52,6 +49,7 @@ namespace MvcCoreTemplate.Web
// Add application services.
services.AddTransient<IEmailSender, AuthMessageSender>();
services.AddTransient<ISmsSender, AuthMessageSender>();
services.AddTransient<ICommonService, CommonService>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
......
@{
@model string
@{
ViewData["Title"] = "Home Page";
}
......@@ -19,6 +20,7 @@
Learn More
</a>
</p>
<p>@Model</p>
</div>
</div>
<div class="item">
......
......@@ -21,6 +21,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvcCoreTemplate.Common", "M
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcCoreTemplate.Web.Infrastructure", "MvcCoreTemplate.Web.Infrastructure\MvcCoreTemplate.Web.Infrastructure.csproj", "{BB1F48A6-56F0-42B9-B2E2-9D84842A6CC8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{3A79ADCA-45DD-43CE-8D3E-4D5F10945C4E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcCoreTemplate.Services.Data", "MvcCoreTemplate.Services.Data\MvcCoreTemplate.Services.Data.csproj", "{2EF76BFD-952F-4B4A-B82A-5F495DFD21D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcCoreTemplate.Services.Web", "MvcCoreTemplate.Services.Web\MvcCoreTemplate.Services.Web.csproj", "{61EEFBFD-1C6F-4F6B-9D2D-9D0C5BD5E71E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -43,10 +49,21 @@ Global
{091BEF53-262A-42DC-8C5A-C4762919F59A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{091BEF53-262A-42DC-8C5A-C4762919F59A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{091BEF53-262A-42DC-8C5A-C4762919F59A}.Release|Any CPU.Build.0 = Release|Any CPU
<<<<<<< HEAD
{BB1F48A6-56F0-42B9-B2E2-9D84842A6CC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB1F48A6-56F0-42B9-B2E2-9D84842A6CC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB1F48A6-56F0-42B9-B2E2-9D84842A6CC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB1F48A6-56F0-42B9-B2E2-9D84842A6CC8}.Release|Any CPU.Build.0 = Release|Any CPU
=======
{2EF76BFD-952F-4B4A-B82A-5F495DFD21D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EF76BFD-952F-4B4A-B82A-5F495DFD21D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EF76BFD-952F-4B4A-B82A-5F495DFD21D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2EF76BFD-952F-4B4A-B82A-5F495DFD21D0}.Release|Any CPU.Build.0 = Release|Any CPU
{61EEFBFD-1C6F-4F6B-9D2D-9D0C5BD5E71E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61EEFBFD-1C6F-4F6B-9D2D-9D0C5BD5E71E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61EEFBFD-1C6F-4F6B-9D2D-9D0C5BD5E71E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61EEFBFD-1C6F-4F6B-9D2D-9D0C5BD5E71E}.Release|Any CPU.Build.0 = Release|Any CPU
>>>>>>> master
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -56,6 +73,11 @@ Global
{C34194B5-7ACE-41B7-A7E4-CFB974586F27} = {79B56892-66B0-4FE6-9A8C-D7F0D26F0DD1}
{68C6102D-07D6-4C85-B682-9BCECDF8BD3F} = {C19362E2-DE5D-410B-80E4-F7C949FFBD2B}
{091BEF53-262A-42DC-8C5A-C4762919F59A} = {880AD230-6FB7-4652-BFF3-B5EFA22F976B}
<<<<<<< HEAD
{BB1F48A6-56F0-42B9-B2E2-9D84842A6CC8} = {9680B400-5AB2-48DA-BF05-D62C9E9E50B9}
=======
{2EF76BFD-952F-4B4A-B82A-5F495DFD21D0} = {3A79ADCA-45DD-43CE-8D3E-4D5F10945C4E}
{61EEFBFD-1C6F-4F6B-9D2D-9D0C5BD5E71E} = {3A79ADCA-45DD-43CE-8D3E-4D5F10945C4E}
>>>>>>> master
EndGlobalSection
EndGlobal
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment