简体   繁体   English

在 ASP.NET CORE MVC 中使用 CRUD 操作的 ViewComponent

[英]ViewComponent With CRUD Operations in ASP.NET CORE MVC

I have a list with multiple list item, when i fill list header's properties then i'm allowed to add list item.我有一个包含多个列表项的列表,当我填充列表标题的属性时,我可以添加列表项。

  • List Item need to have CRUD functionality.列表项需要具有 CRUD 功能。

  • List must be a grid列表必须是网格

  • Adding to List must with creating new record and fill it instantly添加到列表必须创建新记录并立即填充

I'm very novice to ASP.Net Core MVC, i read some articles about ViewComponent to accomplish that but i'm not convinced that it can be a solution for my problem.我是 ASP.Net Core MVC 的新手,我阅读了一些关于 ViewComponent 的文章来实现这一点,但我不相信它可以解决我的问题。

List Item need to have CRUD functionality列表项需要具有 CRUD 功能

List must be a grid列表必须是网格

Adding to List must with creating new record and fill it instantly添加到列表必须创建新记录并立即填充

So write logic in action of ViewComponent (for example with if statement based on parameters passed to action).因此,在ViewComponent action 中编写逻辑(例如, if基于传递给 action 的参数的if语句)。 I dont understand where is a problem in this basic things.我不明白这个基本的东西哪里有问题。 If you are new into ASP.NET Core i can reccomend read official docs about view components but better start from .Net Core basic tutorials (and some C# tutorials...)如果您是 ASP.NET Core 的新手,我可以推荐阅读有关视图组件的官方文档,但最好从.Net Core 基础教程(和一些 C# 教程...)开始

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM