From 2ee8686e9b3dac2ea4955ceee083b96b8643bfce Mon Sep 17 00:00:00 2001
From: Vasil Bukoev <105813259+vbukoev@users.noreply.github.com>
Date: Wed, 17 Apr 2024 15:36:15 +0300
Subject: [PATCH 1/9] Update Register.cshtml
---
CourseNet/Views/User/Register.cshtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CourseNet/Views/User/Register.cshtml b/CourseNet/Views/User/Register.cshtml
index 1e9f0a5..80c2aba 100644
--- a/CourseNet/Views/User/Register.cshtml
+++ b/CourseNet/Views/User/Register.cshtml
@@ -35,7 +35,7 @@
- Register
+ Регистрирай се
From 085eca78a6a29ad7551691541c65bf156efa492d Mon Sep 17 00:00:00 2001
From: Vasil Bukoev <105813259+vbukoev@users.noreply.github.com>
Date: Fri, 19 Apr 2024 16:17:07 +0300
Subject: [PATCH 2/9] Update Course.cs
---
CourseNet.Data.Models/Entities/Course.cs | 3 ---
1 file changed, 3 deletions(-)
diff --git a/CourseNet.Data.Models/Entities/Course.cs b/CourseNet.Data.Models/Entities/Course.cs
index cb6d92a..a25da63 100644
--- a/CourseNet.Data.Models/Entities/Course.cs
+++ b/CourseNet.Data.Models/Entities/Course.cs
@@ -74,9 +74,6 @@ public Course()
[Comment("Collection of Categories")]
public virtual ICollection Categories { get; set; } = new HashSet();
- //[Comment("Collection of Students")]
- //public virtual ICollection Students { get; set; } = new HashSet();
-
[Comment("Collection of Lectures")]
public virtual ICollection Lectures { get; set; } = new HashSet();
From 03b2d6f19a95d91f51f1d702cfa31f0b71ce5e42 Mon Sep 17 00:00:00 2001
From: Vasil Bukoev <105813259+vbukoev@users.noreply.github.com>
Date: Fri, 19 Apr 2024 16:17:18 +0300
Subject: [PATCH 3/9] Update CourseStatus.cs
---
CourseNet.Data.Models/Entities/Enums/CourseStatus.cs | 1 -
1 file changed, 1 deletion(-)
diff --git a/CourseNet.Data.Models/Entities/Enums/CourseStatus.cs b/CourseNet.Data.Models/Entities/Enums/CourseStatus.cs
index d2ec131..10af704 100644
--- a/CourseNet.Data.Models/Entities/Enums/CourseStatus.cs
+++ b/CourseNet.Data.Models/Entities/Enums/CourseStatus.cs
@@ -3,7 +3,6 @@
public enum CourseStatus
{
Active,
- Inactive,
Completed,
Archived
}
From 80c39857e54ffdf94d5f45622c4c7690a0f4a190 Mon Sep 17 00:00:00 2001
From: Vasil Bukoev <105813259+vbukoev@users.noreply.github.com>
Date: Fri, 19 Apr 2024 16:17:22 +0300
Subject: [PATCH 4/9] Update DecimalModelBinderProvider.cs
---
.../ModelBinders/DecimalModelBinderProvider.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/CourseNet.Web.Infrastructure/ModelBinders/DecimalModelBinderProvider.cs b/CourseNet.Web.Infrastructure/ModelBinders/DecimalModelBinderProvider.cs
index 316c43d..c6de567 100644
--- a/CourseNet.Web.Infrastructure/ModelBinders/DecimalModelBinderProvider.cs
+++ b/CourseNet.Web.Infrastructure/ModelBinders/DecimalModelBinderProvider.cs
@@ -4,13 +4,16 @@ namespace CourseNet.Web.Infrastructure.ModelBinders
{
public class DecimalModelBinderProvider : IModelBinderProvider
{
+ // ModelBinderProviderContext is a context object for creating an IModelBinder.
public IModelBinder GetBinder(ModelBinderProviderContext context)
{
+ // If the context is null, throw an ArgumentNullException.
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}
-
+ // If the model type is decimal or decimal?, return a new DecimalModelBinder.
+ // The DecimalModelBinder is a custom model binder for decimal and decimal? types.
if (context.Metadata.ModelType == typeof(decimal) || context.Metadata.ModelType == typeof(decimal?))
{
return new DecimalModelBinder();
From 0b1994d8267212a5a7fa6f60a8490adb4e381c2e Mon Sep 17 00:00:00 2001
From: Vasil Bukoev <105813259+vbukoev@users.noreply.github.com>
Date: Fri, 19 Apr 2024 16:17:25 +0300
Subject: [PATCH 5/9] Update Material.cs
---
CourseNet.Data.Models/Entities/Material.cs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/CourseNet.Data.Models/Entities/Material.cs b/CourseNet.Data.Models/Entities/Material.cs
index e822dd1..639002f 100644
--- a/CourseNet.Data.Models/Entities/Material.cs
+++ b/CourseNet.Data.Models/Entities/Material.cs
@@ -1,7 +1,6 @@
-using System.ComponentModel.DataAnnotations;
-using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using CourseNet.Common.DataConstants;
using static CourseNet.Common.DataConstants.Material;
namespace CourseNet.Data.Models.Entities
{
From 09f807c2552a1a15b18915ca2dd2341874191d0e Mon Sep 17 00:00:00 2001
From: Vasil Bukoev <105813259+vbukoev@users.noreply.github.com>
Date: Fri, 19 Apr 2024 16:17:32 +0300
Subject: [PATCH 6/9] Update StartUp.cs
---
CourseNet/StartUp.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/CourseNet/StartUp.cs b/CourseNet/StartUp.cs
index 34b68d3..9f36e8f 100644
--- a/CourseNet/StartUp.cs
+++ b/CourseNet/StartUp.cs
@@ -40,6 +40,7 @@
cfg.AccessDeniedPath = "/Home/Error/401";
});
+// Add services to the container automatically due to the ModelBinderProvider.
builder.Services
.AddControllersWithViews()
.AddMvcOptions(options =>
From fd5224d616aa5d2940091b7646842c8055486019 Mon Sep 17 00:00:00 2001
From: Vasil Bukoev <105813259+vbukoev@users.noreply.github.com>
Date: Fri, 19 Apr 2024 16:37:29 +0300
Subject: [PATCH 7/9] Update CategoriesController.cs
---
CourseNet/Controllers/CategoriesController.cs | 1 -
1 file changed, 1 deletion(-)
diff --git a/CourseNet/Controllers/CategoriesController.cs b/CourseNet/Controllers/CategoriesController.cs
index 3aed875..f496411 100644
--- a/CourseNet/Controllers/CategoriesController.cs
+++ b/CourseNet/Controllers/CategoriesController.cs
@@ -257,7 +257,6 @@ private IActionResult GeneralError()
{
TempData[ErrorMessage] = GeneralErrorMessage;
return RedirectToAction("Index", "Home");
-
}
}
}
From 8f352cb4dee20948bbca9bd8b8a01c12609e718d Mon Sep 17 00:00:00 2001
From: Vasil Bukoev <105813259+vbukoev@users.noreply.github.com>
Date: Fri, 19 Apr 2024 16:37:31 +0300
Subject: [PATCH 8/9] Update UserViewModel.cs
---
CourseNet.Web.ViewModels/User/UserViewModel.cs | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/CourseNet.Web.ViewModels/User/UserViewModel.cs b/CourseNet.Web.ViewModels/User/UserViewModel.cs
index 39948cc..3bfb395 100644
--- a/CourseNet.Web.ViewModels/User/UserViewModel.cs
+++ b/CourseNet.Web.ViewModels/User/UserViewModel.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace CourseNet.Web.ViewModels.User
+namespace CourseNet.Web.ViewModels.User
{
public class UserViewModel
{
From 3ad72abb8073a86cb164d0c1c0c403a4b67359ec Mon Sep 17 00:00:00 2001
From: Vasil Bukoev <105813259+vbukoev@users.noreply.github.com>
Date: Fri, 19 Apr 2024 16:37:33 +0300
Subject: [PATCH 9/9] Update LoginFormModel.cs
---
CourseNet.Web.ViewModels/User/LoginFormModel.cs | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/CourseNet.Web.ViewModels/User/LoginFormModel.cs b/CourseNet.Web.ViewModels/User/LoginFormModel.cs
index 5feebfb..4984629 100644
--- a/CourseNet.Web.ViewModels/User/LoginFormModel.cs
+++ b/CourseNet.Web.ViewModels/User/LoginFormModel.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.ComponentModel.DataAnnotations;
namespace CourseNet.Web.ViewModels.User
{