shopping-assistant-web-client/ShoppingAssistantWebClient.Web/Pages/Wishlist.cshtml.cs
2023-10-15 22:14:31 +00:00

29 lines
992 B
C#

using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using ShoppingAssistantWebClient.Web.Models;
namespace ShoppingAssistantWebClient.Web.Pages
{
public class WishlistModel : PageModel
{
public List<Models.WishlistModel> wishlist = new List<Models.WishlistModel>{
new Models.WishlistModel {Id = "0", Name = "Chat1", Type="product", CreateById="0"},
new Models.WishlistModel {Id = "1", Name = "Chat2", Type="gift", CreateById="1"},
new Models.WishlistModel {Id = "2", Name = "Chat3", Type="product", CreateById="2"}
};
public void OnGet()
{
}
public void OnPostDelete(string id) {
var item = wishlist.FirstOrDefault(wishlist => wishlist.Id == id);
wishlist.RemoveAt(Int32.Parse(id));
}
public IActionResult OnPostMoveToChat() {
return RedirectToPage("Index");
}
}
}