├── CoreLMS.Web ├── Pages │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Privacy.cshtml │ ├── Shared │ │ ├── _ValidationScriptsPartial.cshtml │ │ └── _Layout.cshtml │ ├── Index.cshtml │ ├── Index.cshtml.cs │ ├── Privacy.cshtml.cs │ ├── Error.cshtml.cs │ └── Error.cshtml ├── Areas │ └── Admin │ │ ├── Pages │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Shared │ │ │ ├── _ValidationScriptsPartial.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ ├── Courses │ │ │ ├── Create.cshtml.cs │ │ │ ├── Delete.cshtml │ │ │ ├── Details.cshtml.cs │ │ │ ├── Details.cshtml │ │ │ ├── Delete.cshtml.cs │ │ │ ├── Index.cshtml.cs │ │ │ ├── Create.cshtml │ │ │ ├── Edit.cshtml │ │ │ ├── Index.cshtml │ │ │ └── Edit.cshtml.cs │ │ └── Authors │ │ │ ├── Create.cshtml.cs │ │ │ ├── Index.cshtml.cs │ │ │ ├── Details.cshtml.cs │ │ │ ├── Delete.cshtml.cs │ │ │ ├── Delete.cshtml │ │ │ ├── Edit.cshtml.cs │ │ │ ├── Details.cshtml │ │ │ ├── Index.cshtml │ │ │ ├── Create.cshtml │ │ │ └── Edit.cshtml │ │ └── Models │ │ ├── CourseViewModel.cs │ │ └── AuthorViewModel.cs ├── wwwroot │ ├── favicon.ico │ ├── js │ │ └── site.js │ ├── lib │ │ ├── jquery-validation-unobtrusive │ │ │ ├── LICENSE.txt │ │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ │ └── LICENSE.md │ │ ├── bootstrap │ │ │ ├── LICENSE │ │ │ └── dist │ │ │ │ └── css │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ └── bootstrap-reboot.css │ │ └── jquery │ │ │ └── LICENSE.txt │ └── css │ │ ├── site.css │ │ └── admin.css ├── Properties │ ├── serviceDependencies.json │ ├── serviceDependencies.local.json │ └── launchSettings.json ├── appsettings.Development.json ├── appsettings.json ├── ScaffoldingReadMe.txt ├── Program.cs ├── CoreLMS.Web.csproj └── Startup.cs ├── CoreLMS.Persistence ├── Entity.cs ├── AppDbContextFactory.cs ├── CoreLMS.Persistence.csproj ├── Migrations │ ├── 20200729172853_InitialCourseEntityWork.cs │ ├── 20200805184515_AuthorsToCourseLessons.cs │ ├── 20200729172853_InitialCourseEntityWork.Designer.cs │ ├── 20201104181704_AuthorPersonUpdate.cs │ ├── 20200805182225_CourseLessonsAndAuthors.cs │ ├── 20200805182225_CourseLessonsAndAuthors.Designer.cs │ ├── 20201104181704_AuthorPersonUpdate.Designer.cs │ └── AppDbContextModelSnapshot.cs ├── AppDbContext.Authors.cs ├── AppDbContext.Courses.cs └── AppDbContext.cs ├── CoreLMS.Core ├── Interfaces │ ├── IAppDbContext.cs │ ├── ICourseLessonService.cs │ ├── IAuditableEntity.cs │ ├── IAppDbContext.Authors.cs │ ├── IAppDbContext.Courses.cs │ ├── IAuthorService.cs │ └── ICourseService.cs ├── Types │ ├── LessonType.cs │ ├── CourseType.cs │ └── VideoSourceType.cs ├── CoreLMS.Core.csproj ├── Entities │ ├── AuthorCourseLesson.cs │ ├── CourseLessonAttachment.cs │ ├── Course.cs │ ├── CourseLesson.cs │ └── Author.cs ├── DataTransferObjects │ ├── Courses │ │ ├── CreateCourseDto.cs │ │ ├── UpdateCourseDto.cs │ │ └── CourseLessons │ │ │ └── CreateCourseLessonDto.cs │ └── Authors │ │ ├── CreateAuthorDto.cs │ │ └── UpdateAuthorDto.cs └── Exceptions │ └── ApplicationException.cs ├── CoreLMS.Infrastructure └── CoreLMS.Infrastructure.csproj ├── CoreLMS.Tests ├── Services │ ├── Courses │ │ ├── CourseServiceTests.CourseLessons.cs │ │ ├── CourseServiceTests.Exceptions.cs │ │ └── CourseServiceTests.cs │ └── Authors │ │ ├── AuthorServiceTests.Exceptions.cs │ │ └── AuthorServiceTests.cs └── CoreLMS.Tests.csproj ├── .dockerignore ├── CoreLMS.Application ├── CoreLMS.Application.csproj ├── Services │ ├── AuthorService │ │ ├── AuthorService.Validations.cs │ │ └── AuthorService.cs │ ├── CourseLessonService │ │ └── CourseLessonService.cs │ └── CourseService │ │ ├── CourseService.Validations.cs │ │ └── CourseService.cs └── Validators │ └── ModelValidator.cs ├── LICENSE.md ├── README.md ├── CoreLMS.sln └── .gitignore /CoreLMS.Web/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /CoreLMS.Web/Areas/Admin/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /CoreLMS.Persistence/Entity.cs: -------------------------------------------------------------------------------- 1 | namespace CoreLMS.Persistence 2 | { 3 | internal class Entity 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /CoreLMS.Web/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FitzyCodesThings/core-lms/HEAD/CoreLMS.Web/wwwroot/favicon.ico -------------------------------------------------------------------------------- /CoreLMS.Web/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /CoreLMS.Web/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using CoreLMS.Web 2 | @namespace CoreLMS.Web.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /CoreLMS.Web/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /CoreLMS.Core/Interfaces/IAppDbContext.cs: -------------------------------------------------------------------------------- 1 | namespace CoreLMS.Core.Interfaces 2 | { 3 | public partial interface IAppDbContext 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CoreLMS.Web/Areas/Admin/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using CoreLMS.Core.Types 2 | @using CoreLMS.Web.Areas.Admin 3 | @namespace CoreLMS.Web.Areas.Admin.Pages 4 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 5 | -------------------------------------------------------------------------------- /CoreLMS.Web/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "Privacy Policy"; 5 | } 6 |
Use this page to detail your site's privacy policy.
9 | -------------------------------------------------------------------------------- /CoreLMS.Web/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /CoreLMS.Web/Areas/Admin/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /CoreLMS.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /CoreLMS.Web/Areas/Admin/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = "CoreLMS Administration"; 5 | } 6 | 7 |Learn about building Web apps with ASP.NET Core.
10 |
13 | Request ID: @Model.RequestId
14 |
19 | Swapping to the Development environment displays detailed information about the error that occurred. 20 |
21 |22 | The Development environment shouldn't be enabled for deployed applications. 23 | It can result in displaying sensitive information from exceptions to end users. 24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 25 | and restarting the app. 26 |
27 | -------------------------------------------------------------------------------- /CoreLMS.Core/Entities/Course.cs: -------------------------------------------------------------------------------- 1 | using CoreLMS.Core.Interfaces; 2 | using CoreLMS.Core.Types; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.Text; 7 | 8 | namespace CoreLMS.Core.Entities 9 | { 10 | public class Course : IAuditableEntity 11 | { 12 | public Course() 13 | { 14 | this.CourseLessons = new HashSet| 14 | @Html.DisplayNameFor(model => model.Courses[0].Name) 15 | | 16 |17 | @Html.DisplayNameFor(model => model.Courses[0].Description) 18 | | 19 |20 | @Html.DisplayNameFor(model => model.Courses[0].CourseType) 21 | | 22 |23 | @Html.DisplayNameFor(model => model.Courses[0].CourseImageURL) 24 | | 25 |26 | @Html.DisplayNameFor(model => model.Courses[0].DateCreated) 27 | | 28 |29 | @Html.DisplayNameFor(model => model.Courses[0].DateUpdated) 30 | | 31 |32 | |
|---|---|---|---|---|---|---|
| 39 | @Html.DisplayFor(modelItem => item.Name) 40 | | 41 |42 | @Html.DisplayFor(modelItem => item.Description) 43 | | 44 |45 | @Html.DisplayFor(modelItem => item.CourseType) 46 | | 47 |48 | @Html.DisplayFor(modelItem => item.CourseImageURL) 49 | | 50 | @Html.DisplayFor(modelItem => item.DateCreated) 51 | | 52 |53 | @Html.DisplayFor(modelItem => item.DateUpdated) 54 | | 55 | 56 |57 | Edit | 58 | Details | 59 | Delete 60 | | 61 |
67 | Create New Course 68 |
69 | -------------------------------------------------------------------------------- /CoreLMS.Web/Areas/Admin/Pages/Authors/Delete.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Microsoft.EntityFrameworkCore; 8 | using CoreLMS.Core.Entities; 9 | using CoreLMS.Persistence; 10 | using CoreLMS.Core.Interfaces; 11 | using CoreLMS.Core.DataTransferObjects; 12 | 13 | namespace CoreLMS.Web.Areas.Admin.Pages.Authors 14 | { 15 | public class DeleteModel : PageModel 16 | { 17 | private readonly IAuthorService authorService; 18 | 19 | public DeleteModel(IAuthorService authorService) 20 | { 21 | this.authorService = authorService; 22 | } 23 | 24 | [BindProperty] 25 | public UpdateAuthorDto AuthorDto { get; set; } 26 | 27 | public async Task| 14 | @Html.DisplayNameFor(model => model.Authors[0].FirstName) 15 | | 16 |17 | @Html.DisplayNameFor(model => model.Authors[0].MiddleName) 18 | | 19 |20 | @Html.DisplayNameFor(model => model.Authors[0].LastName) 21 | | 22 |23 | @Html.DisplayNameFor(model => model.Authors[0].Suffix) 24 | | 25 |26 | @Html.DisplayNameFor(model => model.Authors[0].ContactEmail) 27 | | 28 |29 | @Html.DisplayNameFor(model => model.Authors[0].ContactPhoneNumber) 30 | | 31 |32 | @Html.DisplayNameFor(model => model.Authors[0].Description) 33 | | 34 |35 | @Html.DisplayNameFor(model => model.Authors[0].WebsiteURL) 36 | | 37 |38 | @Html.DisplayNameFor(model => model.Authors[0].DateCreated) 39 | | 40 |41 | @Html.DisplayNameFor(model => model.Authors[0].DateUpdated) 42 | | 43 |44 | |
|---|---|---|---|---|---|---|---|---|---|---|
| 50 | @Html.DisplayFor(modelItem => item.FirstName) 51 | | 52 |53 | @Html.DisplayFor(modelItem => item.MiddleName) 54 | | 55 |56 | @Html.DisplayFor(modelItem => item.LastName) 57 | | 58 |59 | @Html.DisplayFor(modelItem => item.Suffix) 60 | | 61 |62 | @Html.DisplayFor(modelItem => item.ContactEmail) 63 | | 64 |65 | @Html.DisplayFor(modelItem => item.ContactPhoneNumber) 66 | | 67 |68 | @Html.DisplayFor(modelItem => item.Description) 69 | | 70 |71 | @Html.DisplayFor(modelItem => item.WebsiteURL) 72 | | 73 |74 | @Html.DisplayFor(modelItem => item.DateCreated) 75 | | 76 |77 | @Html.DisplayFor(modelItem => item.DateUpdated) 78 | | 79 |80 | Edit | 81 | Details | 82 | Delete 83 | | 84 |
90 | Create New Author 91 |
92 | -------------------------------------------------------------------------------- /CoreLMS.Tests/Services/Authors/AuthorServiceTests.Exceptions.cs: -------------------------------------------------------------------------------- 1 | using CoreLMS.Core.DataTransferObjects; 2 | using CoreLMS.Core.Entities; 3 | using Moq; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.ComponentModel.DataAnnotations; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using Tynamix.ObjectFiller; 10 | using Xunit; 11 | 12 | namespace CoreLMS.Tests.Services.Authors 13 | { 14 | public partial class AuthorServiceTests 15 | { 16 | [Fact] 17 | public async Task GetAuthorAsync_ShouldThrowApplicationExceptionWhenIdIsNotFound() 18 | { 19 | // given (arrange) 20 | int invalidId = 100; 21 | Author invalidAuthor = null; 22 | 23 | this.appDbContextMock.Setup(db => 24 | db.SelectAuthorByIdAsync(invalidId)) 25 | .ReturnsAsync(invalidAuthor); 26 | 27 | // when (act) 28 | var subjectTask = subject.GetAuthorAsync(invalidId); 29 | 30 | // then (assert) 31 | await Assert.ThrowsAsync