Skip to content

minor regulations #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
9 changes: 2 additions & 7 deletions AspnetRunBasics/Entities/Cart.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;

namespace AspnetRunBasics.Entities
{
Expand All @@ -12,13 +13,7 @@ public decimal TotalPrice
{
get
{
decimal totalprice = 0;
foreach (var item in Items)
{
totalprice += item.Price * item.Quantity;
}

return totalprice;
return Items.Sum(item => item.Price * item.Quantity);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Pages/Cart.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Threading.Tasks;
using AspnetRunBasics.Entities;
using AspnetRunBasics.Repositories;
using AspnetRunBasics.Repositories.Interfaces;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Pages/CheckOut.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using AspnetRunBasics.Repositories;
using AspnetRunBasics.Repositories.Interfaces;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using AspnetRunBasics.Repositories;
using AspnetRunBasics.Repositories.Interfaces;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Pages/Order.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using AspnetRunBasics.Repositories;
using AspnetRunBasics.Repositories.Interfaces;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Pages/Product.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Threading.Tasks;
using AspnetRunBasics.Repositories;
using AspnetRunBasics.Repositories.Interfaces;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Pages/ProductDetail.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using AspnetRunBasics.Repositories;
using AspnetRunBasics.Repositories.Interfaces;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Repositories/CartRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using AspnetRunBasics.Repositories.Interfaces;

namespace AspnetRunBasics.Repositories
{
Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Repositories/ContactRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using AspnetRunBasics.Entities;
using System;
using System.Threading.Tasks;
using AspnetRunBasics.Repositories.Interfaces;

namespace AspnetRunBasics.Repositories
{
Expand Down
6 changes: 3 additions & 3 deletions AspnetRunBasics/Repositories/Interfaces/ICartRepository.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using AspnetRunBasics.Entities;
using System.Threading.Tasks;
using System.Threading.Tasks;
using AspnetRunBasics.Entities;

namespace AspnetRunBasics.Repositories
namespace AspnetRunBasics.Repositories.Interfaces
{
public interface ICartRepository
{
Expand Down
6 changes: 3 additions & 3 deletions AspnetRunBasics/Repositories/Interfaces/IContactRepository.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using AspnetRunBasics.Entities;
using System.Threading.Tasks;
using System.Threading.Tasks;
using AspnetRunBasics.Entities;

namespace AspnetRunBasics.Repositories
namespace AspnetRunBasics.Repositories.Interfaces
{
public interface IContactRepository
{
Expand Down
6 changes: 3 additions & 3 deletions AspnetRunBasics/Repositories/Interfaces/IOrderRepository.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using AspnetRunBasics.Entities;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
using AspnetRunBasics.Entities;

namespace AspnetRunBasics.Repositories
namespace AspnetRunBasics.Repositories.Interfaces
{
public interface IOrderRepository
{
Expand Down
6 changes: 3 additions & 3 deletions AspnetRunBasics/Repositories/Interfaces/IProductRepository.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using AspnetRunBasics.Entities;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
using AspnetRunBasics.Entities;

namespace AspnetRunBasics.Repositories
namespace AspnetRunBasics.Repositories.Interfaces
{
public interface IProductRepository
{
Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Repositories/OrderRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AspnetRunBasics.Repositories.Interfaces;

namespace AspnetRunBasics.Repositories
{
Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Repositories/ProductRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Threading.Tasks;
using AspnetRunBasics.Data;
using AspnetRunBasics.Entities;
using AspnetRunBasics.Repositories.Interfaces;
using Microsoft.EntityFrameworkCore;

namespace AspnetRunBasics.Repositories
Expand Down
1 change: 1 addition & 0 deletions AspnetRunBasics/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using AspnetRunBasics.Data;
using AspnetRunBasics.Repositories;
using AspnetRunBasics.Repositories.Interfaces;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
Expand Down