asp.net-core-2.0

How to make a transaction in asp.net-core 2.0?

荒凉一梦 提交于 2019-12-24 12:14:04
问题 I want to update some values but in case one fails I need to rollback. How can I do this in asp.net-core-2.0? I have not found any answers yet. Is this because it is not yet supported? In that case what are some alternatives? 回答1: Yes man, using System.Transactions.TransactionScope, available since .Net Core 2.0 and above. check this: Using System.Transactions in ASP.NET: https://msdn.microsoft.com/en-us/ms229977 Implementing an Implicit Transaction using Transaction Scope: https://msdn

How to create user defined functions using code first in ABP?

我的未来我决定 提交于 2019-12-24 11:29:49
问题 I want to create some user-defined functions using code first approach in abp framework. I have created stored procedures xyz by adding xyz.sql inside EntityFrameworkCore\Migrations\Stored Procedures folder, But not able to find a way to create a function, please help. 来源: https://stackoverflow.com/questions/48262776/how-to-create-user-defined-functions-using-code-first-in-abp

What SQL Server 2017 features are not supported in Entity Framework Core code first?

走远了吗. 提交于 2019-12-24 11:12:39
问题 Our team is thinking of utilizing Entity Framework Core code-first to help model the database. We can have both DB projects and EF models, as per article here Database Projects vs. Entity Framework Database Migrations utilizing schema compares, just trying to figure out what will be the source of truth? Does Entity Framework support all features in SQL Server SSDT Database Projects? What features does EF Core 2 not support? (eg, does it not support any of following: triggers, views, functions

NGINX reverse proxy not working for .NET core webAPI running in Docker

廉价感情. 提交于 2019-12-24 10:02:32
问题 I have a simple example webAPI in .NET core, running in a docker container. I'm running Nginx also in a docker container as a reverse proxy for https redirection. The webAPI is accessible on http, but when accessing the https url, the API is not responding. I have tried many different configurations in the nginx.conf file. I've tried using localhost, 0.0.0.0, and 127.0.0.1. I've tried using several different ports such as 5000, 8000, and 80. I've tried using upstream and also specifying the

Deploy and host .net core 2.0 and angular 6 app

北城以北 提交于 2019-12-24 05:05:34
问题 Intro: Currently, I have two separate projects. One solution is for .NET core Web API 2.0 and another project is Angular 6 app. I have a problem deploying this to my hosting provider ( asphostsportal ). It consists of one root folder httpdocs where when I publish my API I copy contents of publishing folder. After transferring files via FTP I confirm that my API works by sending a request and getting the response. Now I need to publish my angular project. The simplest way to do so is with ng

.net core console app as windows service- Is it possible to safely kill execution of started process without using Kill() method?

痴心易碎 提交于 2019-12-24 03:07:46
问题 I have a dotnet core 2.2 console app. I hosted it as windows service.(Service name: "MyService1") "MyService1" starts up another dotnet core WebAPI. The problem is, how do I safely kill the WebAPI process when the "MyService1" is stopped? Here is how I tried to do that but I can still see the process in the task manager. public class MyService : IHostedService, IDisposable { private Timer _timer; static Process webAPI; public Task StartAsync(CancellationToken cancellationToken) { _timer = new

.Net Core 2.0 The view 'Index' was not found

柔情痞子 提交于 2019-12-24 03:04:53
问题 I deployed .net core 2.0 application to IIS and I get the following error. InvalidOperationException: The view 'Index' was not found. The following locations were searched: /Views/Home/Index.cshtml /Views/Shared/Index.cshtml This is just a brand new default .net core web template that I am using to test web deploy. I have tried the below code but that doesn't work either. public static void Main(string[] args) { new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory(

Missing/changed API when migrating from DNX to ASP.NET Core 2.0

心已入冬 提交于 2019-12-24 01:55:33
问题 I have been working on migrating an application from obsolete DNX to ASP.NET Core 2.0. While doing so it found that there has been few changes in the namespaces and APIs like Microsoft.AspNet to Microsoft.AspNetCore . Though I have been able to find and fix most of the changes, the below one is causing issue for me: In class inherited from Route , within RouteAsync(RouteContext context) method, with DNX it was context.IsHandled = true; , how do I signify that this has been handled now with

Missing/changed API when migrating from DNX to ASP.NET Core 2.0

泄露秘密 提交于 2019-12-24 01:55:16
问题 I have been working on migrating an application from obsolete DNX to ASP.NET Core 2.0. While doing so it found that there has been few changes in the namespaces and APIs like Microsoft.AspNet to Microsoft.AspNetCore . Though I have been able to find and fix most of the changes, the below one is causing issue for me: In class inherited from Route , within RouteAsync(RouteContext context) method, with DNX it was context.IsHandled = true; , how do I signify that this has been handled now with

ASP.Net Core 2.0 Shutdown Timeout, what issues can I expect using a very long time out of 2 min?

心不动则不痛 提交于 2019-12-24 00:49:34
问题 One of our API servers processes short Cell Phone Videos and the Background process can take up to a min. I am aware of best practices regarding moving this to a WebJob and or using Hangfire. For the hypothetical solution of performing this task on our API Server(It just waits for Azure Media Services by polling unfortunately, so not CPU bound). What are the pitfalls of using a very long Shutdown Timeout as described in: Implement background tasks in microservices with IHostedService and the