【发布时间】:2021-09-20 12:09:05
【问题描述】:
我的数据库中有三个表(Student、Course、All)。当我在 Student & Course 表中添加任何数据时,数据也会添加到 All 表中。
所以,我使用 dynamic 类型的数据来传递 Student 和 Course 类型的数据以保存在 All 表中。
public IActionResult Add(Student model)
{ ...
bool studentData = _studentService.Add(model); //saving in Student table
bool allData= _allService.AddAll(model); // passing 'Student' type data
...
}
在 All 服务中,我有一个类似的功能-
public bool AddAll(dynamic model) // 'Student' type data passed & received as dynamic
{...}
现在,我需要有关 Student 模型类型的详细信息(表名、找到的总数据等)。
有什么方法可以得到吗?如果我使用动态数据类型,是否可以获得学生或课程模型类型信息?
任何建议或帮助将不胜感激 :) 提前致谢!
【问题讨论】:
标签: asp.net-core dynamic asp.net-dynamic-data