git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| using Microsoft.AspNetCore.Http; | |
| using Microsoft.AspNetCore.Routing; | |
| namespace Example | |
| { | |
| public class ByteRangesRouteConstraint : IRouteConstraint | |
| { | |
| public bool Match(HttpContext httpContext, IRouter route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection) | |
| { | |
| if (!values.TryGetValue("url", out var url) || url == null) |
| // Insert some data | |
| db.product_categories.insertMany([ | |
| { | |
| _id: 1, | |
| name: 'Products', | |
| parent_id: null | |
| }, | |
| { | |
| _id: 2, | |
| name: 'Digital & Electronics', |
| function Set-Progress { | |
| param( [int]$Percent ) | |
| if ($Progress -lt 100) { | |
| Write-Host -NoNewline "`e]9;4;1;${Percent}`e\" | |
| } | |
| else { | |
| Write-Host -NoNewline "`e]9;4;0`e\" | |
| } | |
| } |
| // Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice) | |
| // | |
| // Permission to use, copy, modify, and/or distribute this software for any purpose | |
| // with or without fee is hereby granted. | |
| // | |
| // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
| // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | |
| // AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | |
| // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | |
| // OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
Implementing business transactions that span multiple services is not straightforward. Distributed transactions are best avoided because of the CAP theorem. Moreover, many modern (NoSQL) databases don’t support them. The best solution is to use the Saga Pattern.
[...]