-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99c891e
commit bb5d569
Showing
110 changed files
with
4,965 additions
and
253 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.27130.2024 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlServer", "SqlServer\SqlServer.csproj", "{9C99EB70-BB57-4D41-876D-B35234DC4E39}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{9C99EB70-BB57-4D41-876D-B35234DC4E39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{9C99EB70-BB57-4D41-876D-B35234DC4E39}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{9C99EB70-BB57-4D41-876D-B35234DC4E39}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{9C99EB70-BB57-4D41-876D-B35234DC4E39}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5BC14972-1FF4-49F1-A51F-3885C2F43261} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Identity; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.Logging; | ||
using SqlServer.Data; | ||
|
||
namespace SqlServer.Controllers | ||
{ | ||
[Route("[controller]/[action]")] | ||
public class AccountController : Controller | ||
{ | ||
private readonly SignInManager<ApplicationUser> _signInManager; | ||
private readonly ILogger _logger; | ||
|
||
public AccountController(SignInManager<ApplicationUser> signInManager, ILogger<AccountController> logger) | ||
{ | ||
_signInManager = signInManager; | ||
_logger = logger; | ||
} | ||
|
||
[HttpPost] | ||
[ValidateAntiForgeryToken] | ||
public async Task<IActionResult> Logout() | ||
{ | ||
await _signInManager.SignOutAsync(); | ||
_logger.LogInformation("User logged out."); | ||
return RedirectToPage("/Index"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace SqlServer.Data | ||
{ | ||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser> | ||
{ | ||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) | ||
: base(options) | ||
{ | ||
} | ||
|
||
protected override void OnModelCreating(ModelBuilder builder) | ||
{ | ||
base.OnModelCreating(builder); | ||
// Customize the ASP.NET Identity model and override the defaults if needed. | ||
// For example, you can rename the ASP.NET Identity table names and more. | ||
// Add your customizations after calling base.OnModelCreating(builder); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Identity; | ||
|
||
namespace SqlServer.Data | ||
{ | ||
// Add profile data for application users by adding properties to the ApplicationUser class | ||
public class ApplicationUser : IdentityUser | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace SqlServer.Data | ||
{ | ||
public class Contact | ||
{ | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
public string Address { get; set; } | ||
public string City { get; set; } | ||
public string Subregion { get; set; } | ||
public string PostalCode { get; set; } | ||
public string Phone { get; set; } | ||
public string Email { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace SqlServer.Data | ||
{ | ||
public class ContactsDbContext : DbContext | ||
{ | ||
public DbSet<Contact> Contacts { get; set; } | ||
|
||
public ContactsDbContext(DbContextOptions<ContactsDbContext> options) | ||
: base(options) | ||
{ | ||
|
||
} | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
base.OnModelCreating(modelBuilder); | ||
} | ||
} | ||
} |
232 changes: 232 additions & 0 deletions
232
...r/SqlServer/Data/Migrations/Application/20181218120353_ApplicationContextInit.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.