问题更新数据库.NET Core 1.1.2和EF 1.1.2 [英] Issue updating database .NET Core 1.1.2 and EF 1.1.2

查看:51
本文介绍了问题更新数据库.NET Core 1.1.2和EF 1.1.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用.NET Core 1.1.2和EF 1.1.2 ...我有一个简单的网站,我为学校老师管理年鉴在我遇到EF问题之前,一切都顺利进行......

I am using .NET Core 1.1.2, and EF 1.1.2... I have a simple site that I built for a school teacher for managing yearbook stuff... Everything went swimmingly up until I ran into an EF issue...

我有一个非常简单的.NET Razor View来管理年鉴页面布局...没有图像它是一个简单的"标准"带有页码和内容文本列表的剃刀视图...我稍微将列表修改为两列...左列
是偶数编号页面...右侧是ODD编号页面(如果你是看一本书的文字表示)...我设法使用FLEX进行布局,效果很好......自动调整等...

I have a very simple .NET Razor View for managing yearbook page layout... There are no images and it is a simple "standard" razor view with page numbers and contents text list... I have slightly modified the list into two columns... Left column is EVEN numbered pages... The right side is ODD Numbered pages (as you if you are looking at a text representation of a book)... I managed to do the layout using FLEX, and it works great... Auto adjusts, etc...

我的问题是页码编号......我的课很简单......"页面" SQL表有三列...... PageID,PageNumber和Contents ...(分别为int identity,int,varchar(100))。我需要做的是保持页码同步,因为用户在列表上执行
CRUD操作...看起来非常简单,而且我会使用"插入触发器"。在SQL中的Page表上,只需向上或向下调整pagenumber列,具体取决于插入的,已删除的项目......但是,EF Core(或一般的EF)
似乎不喜欢插入,更新,删除触发非常......或者根本...... 

My issue is with page numbering... My class is very simple... "Page" SQL table has three columns... PageID, PageNumber, and Contents... (int identity, int, varchar(100) respectively). What i need to do is keep page numbers in sync as the user does CRUD operations on the list... Seems very simple, and NORMALLY I would use an "insert trigger" on the Page table in SQL and simply adjust the pagenumber column up or down depending on the inserted, deleted item... However, EF Core (or EF in general) doesn't seem to like Insert, Update, Delete triggers very much... or at all... 

我试图在PagesController内的后续函数调用中使用EF Linq查询直接更新记录以更新记录,但是这似乎挂了,并不总是正常工作...我已经尝试了在互联网上找到的其他解决方案...
我终于尝试调用存储过程... NOPE!那么......什么是HECK!

I have attempted to update the records directly using EF Linq queries in subsequent function calls inside the PagesController to update the records, but this seems to hang, and doesn't always work properly... I have tried other solutions found on the internet... and I finally tried calling a stored procedure... NOPE! So... What the HECK!

任何人都可以在这里提供一些指导......所有具有这种特殊功能的东西都很有效......我只是不能把头包裹在哪里跟着这个怪物吧!任何帮助将不胜感激!!! 

Can anyone provide some guidance here... Everything with this particular functionality is working great... I just can't wrap my head around where to go with this monstrosity! Any help would be appreciated!!! 

推荐答案

您好Stewart_Bash,

Hi Stewart_Bash,

感谢您在此发帖。

>> 我试图在
里面的后续函数调用中直接使用EF Linq查询更新记录,以更新记录,但这似乎挂了,并且总是不能正常工作

您是否提供了有关错误的更多信息?什么挂起了记录的更新?你能为我们提供一些重现错误的代码吗?

Coule you provide more information about your error? What hangs the update of records? Could you provide some code for us to reproduce the error?

最好的问候,

Wendy


这篇关于问题更新数据库.NET Core 1.1.2和EF 1.1.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆