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
9 changes: 0 additions & 9 deletions BL/BL.csproj

This file was deleted.

7 changes: 0 additions & 7 deletions BL/Class1.cs

This file was deleted.

4 changes: 0 additions & 4 deletions DTOs/CategoryDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ public class CategoryDto
public int? CategoryId { get; set; }

public string? CategoryName { get; set; }

//public List<int> productId { get; set; } = new List<int>();

//public virtual ICollection<Product> Products { get; set; } = new List<Product>();
}
}
7 changes: 0 additions & 7 deletions DTOs/Class1.cs

This file was deleted.

6 changes: 0 additions & 6 deletions DTOs/OrderDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@ namespace DTO;

public partial class OrderDto
{
//public int OrderId { get; set; }

//public DateOnly? OrderDate { get; set; }

public int OrderSum { get; set; }

public int UserId { get; set; }

//public List<OrderItemDto> OrderItems { get; set; } = new List<OrderItemDto>();

public virtual ICollection<OrderItemDto> OrderItems { get; set; } = new List<OrderItemDto>();

//public virtual User User { get; set; } = null!;
}
7 changes: 0 additions & 7 deletions DTOs/OrderItemDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@ namespace DTO;
public partial class OrderItemDto

{
//public int OrderItemId { get; set; }


public int? ProductId { get; set; }

//public int OrderId { get; set; }

public int? Quaninty { get; set; }

//public virtual Order Order { get; set; } = null!;

//public virtual Product Product { get; set; } = null!;
}
3 changes: 0 additions & 3 deletions DTOs/ProductDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,4 @@ public class ProductDto

public string? Picture { get; set; }

//public virtual Category? Category { get; set; }

//public virtual ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
}
1 change: 1 addition & 0 deletions DTOs/UserLoginDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class UserLoginDto
{
[EmailAddress]
public string Email { get; set; }

[MaxLength(20)]
public string? Password { get; set; }
}
1 change: 1 addition & 0 deletions DTOs/UserRegister.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class UserRegister
{
[EmailAddress]
public string? Email { get; set; }

[MaxLength(20)]
public string? FirstName { get; set; }

Expand Down
3 changes: 2 additions & 1 deletion DTOs/UserUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ namespace DTO;

public class UserUpdate
{
//public int UserId { get; set; }

[EmailAddress]
public string? Email { get; set; }

[MaxLength(20)]
public string? FirstName { get; set; }

Expand Down
2 changes: 2 additions & 0 deletions Entities/OrderItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ public class OrderItem
public int OrderId { get; set; }

public int Quaninty { get; set; }

[JsonIgnore]
public virtual Order? Order { get; set; } = null!;

[JsonIgnore]
public virtual Product? Product { get; set; } = null!;
}
6 changes: 6 additions & 0 deletions Entities/Rating.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ namespace Entities
public partial class Rating
{
public int RatingId { get; set; }

public string Host { get; set; }

public string Method { get; set; }

public string Path { get; set; }

public string Referer { get; set; }

public string UserAgent { get; set; }

public DateTime? RecordDate { get; set; }
}
}
2 changes: 2 additions & 0 deletions Entities/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ namespace Repositories;
public class User
{
public int UserId { get; set; }

[EmailAddress]
public string? Email { get; set; }

[MaxLength(20)]
public string? FirstName { get; set; }

Expand Down
2 changes: 0 additions & 2 deletions LoginProject/Controllers/ProductController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
using Services;
using System.Collections.Generic;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace LoginProject.Controllers
{
[Route("api/[controller]")]
Expand Down
4 changes: 0 additions & 4 deletions LoginProject/Controllers/categoryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using Services;
using System.Collections.Generic;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace LoginProject.Controllers
{
[Route("api/[controller]")]
Expand Down Expand Up @@ -42,7 +40,5 @@ public async Task<ActionResult<Product>> GetById(int id)
return NotFound();
return Ok(categoryDto);
}


}
}
2 changes: 0 additions & 2 deletions LoginProject/Controllers/orderController .cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using Services;
using System.Collections.Generic;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace LoginProject.Controllers
{
[Route("api/[controller]")]
Expand Down
3 changes: 0 additions & 3 deletions LoginProject/Controllers/usersController.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using Services;
using Microsoft.AspNetCore.Mvc;
using System.Text.Json;
//using Entities;
using Microsoft.AspNetCore.Identity;
using Repositories;
using DTO;
using AutoMapper;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace LoginProject.Controllers
{

Expand Down
1 change: 0 additions & 1 deletion LoginProject/MiddleWare/ErrorHandlingMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace PresidentsApp.Middlewares
{
// You may need to install the Microsoft.AspNetCore.Http.Abstractions package into your project
public class ErrorHandlingMiddleware
{
private readonly RequestDelegate _next;
Expand Down
1 change: 0 additions & 1 deletion LoginProject/MiddleWare/RatingMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace LoginProject.MiddleWare
{
// You may need to install the Microsoft.AspNetCore.Http.Abstractions package into your project
public class RatingMiddleware
{
private readonly RequestDelegate _next;
Expand Down
41 changes: 0 additions & 41 deletions LoginProject/Users.txt

This file was deleted.

30 changes: 1 addition & 29 deletions Repositories/CategotyRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,6 @@ public Task<CategoryDto> getCategoryById(int id)
{
throw new NotImplementedException();
}
//public async Task<List<Product>> getProducts(int position,int skip,string? desc,int? minPrice
// ,int maxPrice, int?[] categoryIds )
//{
// var query = _photoGalleryContext.Products.Where(product=>
// (desc==null ? (true) : (product.Description.Contains(desc)))
// && ((minPrice==null)? (true) :(product.Price >= minPrice))
// && ((maxPrice==null)? (true) : (product.Price<= maxPrice))
// &&((categoryIds.Length==0) ? (true) : (categoryIds.Contains(product.CategoryId))))
// .OrderBy(Product => Product.Price);
// //.Skip((position-1)*skip)
// //.Take(skip);
// Console.WriteLine(query.ToQueryString());
// List<Product> products = await query.ToListAsync();
// return products;



// ;

//}

//public async Task<Product> getProductById(int id)
//{
// var foundProduct = await _photoGalleryContext.Products.FindAsync(id);
// if (foundProduct == null)
// return null;
// return foundProduct;
//}


}
}
4 changes: 2 additions & 2 deletions Repositories/ICategoryRepository .cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace Repositories
{
public interface ICategoryRepository
{
//Task<User> addUser(User user);
Task<CategoryDto> getCategoryById(int id);

Task<List<Category>> getCategories();
//Task<User> updateUser(int id, User userToUpdate);

}
}
3 changes: 2 additions & 1 deletion Repositories/IOrderItemRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ namespace Repositories
public interface IOrderItemRepository
{
OrderItem addOrderItem(OrderItemDto orderItemDto);

Task<List<OrderItemDto>> getAllOrderItems();
//Task<User> updateUser(int id, User userToUpdate);

}
}
1 change: 0 additions & 1 deletion Repositories/IOrderrRepository .cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ namespace Repositories
public interface IOrderRepository
{
Task<Order> addOrder(Order order);

}
}
3 changes: 2 additions & 1 deletion Repositories/IUserRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ namespace Repositories
public interface IUserRepository
{
Task<User> addUser(User user);

Task<User> GetUserByEmailAndPassword(User userLoginDto);
//Task<UserRegister> getUserById(int id);

Task<User> updateUser(int id, User userToUpdate);
}
}
Loading