Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions CourseNet.Data.Models/Entities/Course.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ public Course()
[Comment("Collection of Categories")]
public virtual ICollection<Category> Categories { get; set; } = new HashSet<Category>();

//[Comment("Collection of Students")]
//public virtual ICollection<User> Students { get; set; } = new HashSet<User>();

[Comment("Collection of Lectures")]
public virtual ICollection<Lecture> Lectures { get; set; } = new HashSet<Lecture>();

Expand Down
1 change: 0 additions & 1 deletion CourseNet.Data.Models/Entities/Enums/CourseStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
public enum CourseStatus
{
Active,
Inactive,
Completed,
Archived
}
Expand Down
5 changes: 2 additions & 3 deletions CourseNet.Data.Models/Entities/Material.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 1 addition & 6 deletions CourseNet.Web.ViewModels/User/LoginFormModel.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
8 changes: 1 addition & 7 deletions CourseNet.Web.ViewModels/User/UserViewModel.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
1 change: 0 additions & 1 deletion CourseNet/Controllers/CategoriesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ private IActionResult GeneralError()
{
TempData[ErrorMessage] = GeneralErrorMessage;
return RedirectToAction("Index", "Home");

}
}
}
1 change: 1 addition & 0 deletions CourseNet/StartUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
cfg.AccessDeniedPath = "/Home/Error/401";
});

// Add services to the container automatically due to the ModelBinderProvider.
builder.Services
.AddControllersWithViews()
.AddMvcOptions(options =>
Expand Down
2 changes: 1 addition & 1 deletion CourseNet/Views/User/Register.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<label asp-for="LastName">Фамилия</label>
<span asp-validation-for="LastName" class="text-danger"></span>
</div>
<recaptcha-v3 form-id="registerForm" action="submit" class="w-100 btn btn-lg btn-primary">Register</recaptcha-v3>
<recaptcha-v3 form-id="registerForm" action="submit" class="w-100 btn btn-lg btn-primary">Регистрирай се</recaptcha-v3>
</form>
</div>
</div>
Expand Down