问题标签 [asp.net-boilerplate]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
sql-server-ce - 使用 SQL CE 的 ABP 样板
我有一个使用 EntityFramework 和 SQL Server EF DB 的简单 ASP.NET 应用程序。
问题是,如果我尝试使用 SQL CE(精简版),我的应用程序服务会在第二次调用存储库时引发异常并出现错误:
ExecuteReader 需要一个开放且可用的 Connection。
如果我返回 SQL Express 数据库,一切都会成功。
这是我使用的步骤和代码:
修改客户端应用程序 App.config 文件(我只报告更改):
他们我必须设置 UOW 的隔离级别:
但是在我的 ApplicationService 中,此方法在第二个数据库查询中失败
对存储库的第二次调用总是失败(var tipoCasa = ...
):
我还尝试反转线条。在这种情况下var base100 =
失败:
我收到的错误是:
这里是堆栈跟踪:
System.Reflection.TargetInvocationException HResult=0x80131604
Message=异常已被调用的目标抛出。
Source=mscorlib StackTrace:在 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 在 System.Reflection.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System .Delegate.DynamicInvokeImpl(Object[] args) 在 System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) 在 System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) 在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext 的 ContextCallback 回调,对象状态,布尔值 preserveSyncCtx)。在 System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) 在 System.Windows.Forms.Control.InvokeMarshaledCallbacks() 处运行(ExecutionContext executionContext,ContextCallback 回调,对象状态)
在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows .Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID,Int32 原因,Int32 pvLoopData) 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 原因,ApplicationContext 上下文) 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) 在 System.Windows.Forms.Application.Run(Form mainForm) 在 GPSoftware.Deeds.WinForm.Program.Main() 在 C:\ WA\GPse\NotuleNotai\Notule\Deeds.WinForm\Program.cs:第 34 行
内部异常1:
EntityCommandExecutionException:执行命令定义时发生错误。有关详细信息,请参阅内部异常。
内部异常 2:
InvalidOperationException:ExecuteReader 需要打开且可用的连接。连接的当前状态是关闭。
c# - 使用 SweetAlert 返回错误消息
在AccountController
中,我注意到示例注册代码UserFriendlyException
在ViewBag
.
如何从 SweetAlert 退回它?
html代码
下面的jquery函数
c# - 如何向 ABP 添加新的动态 Web API?
我想向 ASP.NET 样板的 ASP.NET Core 模板添加新的 API。
我试过了,但我总是在 Swagger 上得到响应代码 500。如何添加新的 API?
更新
Mvc.ExceptionHandling.AbpExceptionFilter - 无法创建组件“CityInfo.Models.TempatManager”,因为它需要满足依赖关系。
'CityInfo.Models.TempatManager' 正在等待以下依赖项: - 服务 'Abp.Domain.Repositories.IRepository`1[[CityInfo.Models.Tempat, CityInfo.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken= null]]' 未注册。
c# - 如何通过特定字段(不是主键)获取实体?
我已经成功地通过Id
(主键)获取数据。但是,如果我Get
通过另一个字段调用,为什么总是Id
使用它?
这是我的代码:
ITempatAppService.cs
GetTempatInput.cs
GetTempatOutput.cs
TempatAppService.cs
这是我的TempatManager.cs:
c# - ASP.NET 样板中的 DeleteRange 函数
如何在 ASP.NET Boilerplate MVC 中不使用循环删除实体列表?
目前,我使用:
但我不想使用循环来删除多个实体。
asp.net-core - 加载 AbpModule 中库下创建的应用程序服务
我正在使用 Asp.Net 样板框架。我创建了一个简单的 Asp.Net 核心库,名为Test.ApplicationService
. 我在其中添加了一个名为TestAppService
.
我还创建了另一个 AbpModule 项目,名为Test.ApplicationService.Services
. 它引用了该Test.ApplicationService
项目。我在这个库中添加了 ApplicationModule,如下所示 -
我想TestAppService
在加载我的TestApplicationServiceModule
. 是否可以加载在 ASP.Net Boiler Plate 框架中的普通库下定义的应用程序服务?
c# - 如何使用 Docker 在 Ubuntu 16.04 上发布 asp 样板项目?
我想使用 ABP 将我的项目发布到带有 Docker 的 Ubuntu 16.04,我仍然很困惑,我将 dockerfile 放在 abp 项目中的哪个位置?也许我的 dockerfile 是错误的,
这是我的dockerfile:
我从网上找到了代码,有人可以帮助我吗?我需要一个解释,这样我才能学习。
asp.net - ASP .NET 样板 + MongoDb
我在我的项目中使用 ASP.Net 样板框架 + SQL Server 2016。最近我遇到了从 SQL Server 迁移到 MongoDB 的挑战。我发现可以使用 ASP .NET 样板并安装所需的 NuGet 包,但是,由于缺乏文档,我唯一能做的就是定义相应的 RepositoryBase 类:
据我了解,首先,我现在需要在某处定义连接字符串。然后使用所需的基本数据填充数据库(以前由 EF Core 迁移完成)。显然,新方法中的 EF Core 已过时,这是否意味着我的 DbContext 类也已过时?实际上,有很多关于 ASP .NET 样板和 MongoDB 集成的问题,因此我当前的帖子实际上是请求提供某种现有集成的示例。先感谢您。
authentication - 如何重定向到 ABP 中的登录页面?
- 我从 ASP.NET Boilerplate 网站下载 .NET Core 示例,
- 更改数据库连接字符串,更新数据库,
- 运行 Web Api,成功展示 Swagger,
- 添加主页/索引视图,更改主页/索引操作以返回视图,而不是 Swagger,
- 再次运行,显示主页成功,
- 然后添加一个 Home.Account Controller 和 Home.Account View,登录页面。
- 在主页/索引上添加
AbpMvcAuthentication
属性,我想要的是当访问主页时,重定向到登录页面。
当我转到主页时,它显示一个空页面,不是主页,也不是登录页面。似乎身份验证失败,但没有重定向到登录页面。
我的问题是:当身份验证失败时,如何让AbpMvcAuthentication
知道重定向哪个页面?