本文介绍了如何使用未映射到类的实体框架核心更新表列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的对象在相应的数据库表上有一个DT_Last_Activity,当前没有映射到对象类。



它只会记录当前的日期和时间。



当我使用嵌入式SQL操作数据库时,这很好,它构成了插入或更新语句的一部分。



现在我正在使用.NET MVC Core 2.0和Entity Framework 2.0添加一个Web界面 - 因为我想学习如何使用它们。



这个列是数据库必需的,如果我找不到解决方案,我会将其添加到对象类,但我想知道是否可以使用EF Core更新它而不进行此映射,以便它可以继续保持关闭对象类。



我尝试过:



这是一个我刚刚开始研究的新问题。

解决方案

My objects have a DT_Last_Activity on their corresponding database tables that is not currently mapped to the object classes.

It will only ever record the current date and time.

This was fine when I was manipulating the database using embedded SQL where it formed part of the Insert or Update statement.

Now I am adding a web interface using .NET MVC Core 2.0 and Entity Framework 2.0 - because I want to learn how to use them.

This column is mandatory on the database and if I cannot find a solution I will add it to the object classes but I would like to know if it is possible to update it using EF Core without making this mapping so that it can continue to remain off the object class.

What I have tried:

This is a new problem that I am only beginning to look into.

解决方案


这篇关于如何使用未映射到类的实体框架核心更新表列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 22:44
查看更多