Code Monkey home page Code Monkey logo

eshop's Introduction

dotnet/dotnet - Home of the .NET VMR

This repository is a Virtual Monolithic Repository (VMR) which includes all the source code and infrastructure needed to build the .NET SDK.

What this means:

  • Monolithic - a join of multiple repositories that make up the whole product, such as dotnet/runtime or dotnet/sdk.
  • Virtual - a mirror (not replacement) of product repos where sources from those repositories are synchronized into.

In the VMR, you can find:

Just like the development repositories, the VMR will have a release branch for every feature band (e.g. release/8.0.1xx). Similarly, VMR's main branch will follow main branches of product repositories (see Synchronization Based on Declared Dependencies).

More in-depth documentation about the VMR can be found in VMR Design And Operation. See also dotnet/source-build for more information about our whole-product source-build.

Goals

  • The main purpose of the dotnet/dotnet repository is to have all source code necessary to build the .NET product available in one repository and identified by a single commit.
  • The VMR also aims to become the place from which we release and service future versions of .NET to reduce the complexity of the product construction process. This should allow our partners and and 3rd parties to easily build, test and modify .NET using their custom infrastructure as well as make the process available to the community.
  • Lastly, we hope to solve other problems that the current multi-repo setup brings:
    • Enable the standard down-/up-stream open-source model.
    • Fulfill requirements of .NET distro builders such as RedHat or Canonical to natively include .NET in their distribution repositories.
    • Simplify scenarios such as client-run testing of bug fixes and improvements. The build should work in an offline environment too for certain platforms.
    • Enable developers to make and test changes spanning multiple repositories.
    • More efficient pipeline for security fixes during the CVE pre-disclosure process.

We will achieve these goals while keeping active coding work in the separate repos where it happens today. For example: ASP.NET features will continue to be developed in dotnet/aspnetcore and CLR features will be continue to be developed in dotnet/runtime. Each of these repos have their own distinct communities and processes, and aggregating development into a true mono-repo would work against that. Hence, the "virtual" monolithic repo: the VMR gives us the simplicity of a mono-repo for building and servicing the product, while active development of components of that product stays in its various existing repos. The day to day experience for typical contributors will not change.

Limitations

This is a work-in-progress. There are considerable limitations to what is possible at the moment. For an extensive list of current limitations, please see Temporary Mechanics.
See the Unified Build roadmap for more details.

Supported platforms

  • 8.0
    • source-build configuration on Linux
  • 9.0+ (WIP)
    • source-build configuration on Linux
    • non-source-build configuration on Linux, Mac, and Windows

For the latest information about Source-Build support for new .NET versions, please check our GitHub Discussions page for announcements.

Code flow

For the time being, the source code only flows one way - from the development repos into the VMR. More details on this process:

We expect the code flow to start working both ways in the .NET 9 timeframe. See the Unified Build roadmap for more details.

Contribution

At this time, the VMR will not accept any changes and is a read-only mirror of the development repositories only. Please, make the changes in the respective development repositories (e.g., dotnet/runtime or dotnet/sdk) and they will get synchronized into the VMR automatically.

Dev instructions

Please note that this repository is a work-in-progress and there are some usability issues connected to this. These can be nuisances such as some checked-in files getting modified by the build itself and similar. For the latest information about Source-Build support, please watch for announcements posted on our GitHub Discussions page.

Prerequisites

The dependencies for building can be found here. In case you don't want to / cannot prepare your environment per the requirements, consider using Docker.

Building

  1. Clone the repository

    git clone https://github.com/dotnet/dotnet dotnet-dotnet
    cd dotnet-dotnet
  2. Build the .NET SDK

    Choose one of the following build modes:

    • Microsoft based build

      For Unix:

      ./build.sh --clean-while-building

      For Windows:

      .\build.cmd -cleanWhileBuilding
    • Building from source

      # Prep the source to build on your distro.
      # This downloads a .NET SDK and a number of .NET packages needed to build .NET from source.
      ./prep-source-build.sh
      
      # Build the .NET SDK
      ./build.sh -sb --clean-while-building

    The resulting SDK is placed at artifacts/assets/Release/dotnet-sdk-9.0.100-[your-RID].tar.gz (for Unix) or artifacts/assets/Release/dotnet-sdk-9.0.100-[your-RID].zip (for Windows).

  3. (Optional) Unpack and install the .NET SDK

    For Unix:

    mkdir -p $HOME/dotnet
    tar zxf artifacts/assets/Release/dotnet-sdk-9.0.100-[your-RID].tar.gz -C $HOME/dotnet
    ln -s $HOME/dotnet/dotnet /usr/bin/dotnet

    For Windows:

    mkdir %userprofile%\dotnet
    tar -xf artifacts/assets/Release/dotnet-sdk-9.0.100-[your RID].zip -C %userprofile%\dotnet
    set "PATH=%userprofile%\dotnet;%PATH%"

    To test your built SDK, run the following:

    dotnet --info

Note

Run ./build.sh --help (for Unix) or .\build.cmd -help (for Windows) to see more information about supported build options.

Building using Docker

You can also build the repository using a Docker image which has the required prerequisites inside. The example below creates a Docker volume named vmr and clones and builds the VMR there.

docker run --rm -it -v vmr:/vmr -w /vmr mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8
git clone https://github.com/dotnet/dotnet .

# - Microsoft based build
./build.sh --clean-while-building

# - Building from source
./prep-source-build.sh && ./build.sh -sb --clean-while-building

mkdir -p $HOME/.dotnet
tar -zxf artifacts/assets/Release/dotnet-sdk-9.0.100-centos.8-x64.tar.gz -C $HOME/.dotnet
ln -s $HOME/.dotnet/dotnet /usr/bin/dotnet

Codespaces

You can also utilize GitHub Codespaces where you can find preset containers in this repository.

Building from released sources

You can also build from sources (and not from a context of a git repository), such as the ones you can acquire from a dotnet/dotnet release. In this case, you need to provide additional information which includes the original repository and commit hash the code was built from so that the SDK can provide a better debugging experience (think the Step into.. functionality). Usually, this means the dotnet/dotnet repository together with the commit the release tag is connected to.

In practice, this means that when calling the main build script, you need to provide additional arguments when building outside of a context of a git repository.
Alternatively, you can also provide a manifest file where this information can be read from. This file (release.json) can be found attached with the dotnet/dotnet release.

Synchronizing code into the VMR

Sometimes you want to make a change in a repository and test that change in the VMR. You could of course make the change in the VMR directly (locally, as the VMR is read-only for now) but in case it's already available in your repository, you can synchronize it into the VMR (again locally).

To do this, you can either start a dotnet/dotnet Codespace - you will see instructions right after it starts. Alternatively, you can clone the repository locally and use the vmr-sync.sh or vmr-sync.ps1 script to pull your changes in. Please refer to the documentation in the script for more details.

List of components

The full list of components synchronized into the VMR is here (Components.md).

The repository also contains a JSON manifest listing all components in a machine-readable format.

Filing Issues

This repo does not accept issues as of now. Please file issues to the appropriate development repos. For issues with the VMR itself, please use the source-build repository.

Useful Links

.NET Foundation

.NET Runtime is a .NET Foundation project.

License

.NET is licensed under the MIT license.

eshop's People

Contributors

3lcarry avatar adityamandaleeka avatar almaraubel avatar brennanconroy avatar brunoaragao avatar captainsafia avatar commonsensesoftware avatar damianedwards avatar danmoseley avatar davidfowl avatar dependabot[bot] avatar eerhardt avatar eilon avatar eltociear avatar erinnmclaughlin avatar halilkocaoz avatar jamesmontemagno avatar jbogard avatar jflaga avatar leastprivilege avatar lutzroeder avatar maddymontaquila avatar marioleed avatar martincostello avatar michaelstonis avatar microsoftopensource avatar sebastienros avatar srushtipasari94 avatar stephentoub avatar stevesandersonms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eshop's Issues

Share model classes between projects

From @ReubenBond:

Currently, each project which needs a representation of an Order has its own representation. This makes refactoring complex and it leads to inconsistencies. Instead, we should have one or more shared projects which define the domain model.

If we see a benefit to having a mapped type in some cases (eg, types used in Blazor view models), we should do so, but we should simplify where we can.

[WebToolsE2E][Aspire] Click the endpoint of the webapp in eshop dashboard and open the chatbot, the AI chat window is partially obscured.

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 P1 from build [34303.117.d17.9]
  3. Install latest 8.0 SDK: 8.0.100
  4. Apply NuGet Feeds
  5. Install Docker Desktop

REPRO STEPS

  1. In the VS, clone the eShop repository and open eShop.Web.slnf
  2. F5 / Ctrl-F5
  3. Click Endpoint for 'webapp' and then open AI chatbot

ACTUAL
The AI chat window is partially obscured
image

EXPECTED
image

[WebToolsE2E][Aspire] After running eshop.web solution, some error logs appear in structured logs: "An error occurred using the connection to database 'postgres' on server."

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 P1 from build [34303.117.d17.9]
  3. Install latest 8.0 SDK: 8.0.100
  4. Apply NuGet Feeds
  5. Install Docker Desktop

REPRO STEPS

  1. In the VS, clone the eShop repository and open eShop.Web.slnf
  2. F5 / Ctrl-F5
  3. There are some error logs 'an error occured using the connection to database 'postgres' on server' in Structured Logs

ACTUAL

Fatal error establishing database connection
An error occurred using the connection to database 'postgres' on server 'tcp://localhost:56882'.
image

EXPECTED

There are no errors in Structured Logs.

[WebToolsE2E][Aspire] Registering a new webhook in eshop dashboard failed: "Error 400 (Bad Request) when calling the Webhooks API (POST http://webhooks-api/api/v1/webhooks) with GrantUrl."

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 P1 from build [34303.117.d17.9]
  3. Install latest 8.0 SDK: 8.0.100
  4. Apply NuGet Feeds
  5. Install Docker Desktop

REPRO STEPS

  1. In the VS, clone the eShop repository and open eShop.Web.slnf
  2. F5 / Ctrl-F5
  3. Click Endpoint for 'webhooksclient'
  4. Navigate to webhook registration page and click 'send'

ACTUAL

Error 400 (Bad Request) when calling the Webhooks API (POST http://webhooks-api/api/v1/webhooks) with GrantUrl: http://localhost:5228/check)

Data sent to the webhooks API was {"Url":"http://localhost:5228/webhook-received","Token":"6168DB8D-DC58-4094-AF24-483278923590","Event":"OrderPaid","GrantUrl":"http://localhost:5228/check"}
image

EXPECTED

Registering a new webhook in eshop dashboard successfully.

BasketService can be inconsistent about whether user is authenticated (or at least can disagree with WebApp)

From @SteveSandersonMS

I'm not sure how to repro this but have seen it twice now. You can have a state where the user is logged in and has a non-expired auth token, so WebApp shows you as being logged in, but:

  • Calls to basketClient.GetBasketAsync succeed
  • Calls to basketClient.UpdateBasketAsync fail, reporting RpcException: Status(StatusCode="Unauthenticated", Detail="The caller is not authenticated.")

You can get out of this state by logging out and then back in. But of course we don't want this to occur in the first place.

I suspect the issue is one of two things:

  • Either the WebApp and BasketService disagree about the validity of the auth token, and GetBasketAsync simply doesn't enforce auth at all (perhaps it just returns an empty basket if the user isn't authenticated).
    • If this is the issue, maybe WebApp is incorrectly configured and isn't validating the auth tokens as strictly as it should be. No idea in what way the config might be wrong though - it was taken from the older MVC app.
  • Or, BasketService is internally inconsistent about whether an auth token is valid

Here's what shows up to the user when trying to add an item to the cart in this state:

image

Update .NET MAUI app to use new endpoints

Right now the .NET MAUI app only uses fake mock data. This needs to be updated to use the new endpoints.

Working with @michaelstonis

  • Update design and any performance issues
  • Update to latest .NET 8
  • Use new endpoints
  • Update Mobile BFF with any new apis needed
  • Ability to run with or without auth

Checkout process deletes the basket twice

This isn't a bug (hopefully) but the checkout process currently deletes the basket twice. Once via the webapp and once via the basket API once the order process has started.

image

Scalability/load tests

Would be interesting to see how much traffic we can handle with this architecture and where things start to break down.

It's not possible to run with not the .NET 8.0.100

I installed the latest version of .net and tried to run this application, but it requires a preview version of .NET 8
To solve this, I changed global.json and chose version 8.0.100
Here's the global.json file

{
  "sdk": {
    "version": "8.0.100",
    "rollForward": "latestPatch",
    "allowPrerelease": false
  }
}

[WebToolsE2E][Aspire] When typing โ€˜Ctrl-C' to stop debugging eshop.web, I get some errors:โ€œAspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0] could not remove process's standard output file.โ€

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 P1 from build [34309.102.d17.9]
  3. Install latest 8.0 SDK: 8.0.100
  4. Apply NuGet Feeds
  5. Install Docker Desktop

REPRO STEPS

  1. In the VS, clone the eShop repository and open eShop.Web.slnf
  2. F5 / Ctrl-F5
  3. Enter "Ctrl-C" to stop debugging in the debug console

ACTUAL
fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
could not remove process's standard output file {"Controller": "usvc-dev.developer.microsoft.com/executable-reconciler", "Executable": {"name":"identity-api"}, "Reconciliation": 72, "State": "Running", "ExecutionID": "61", "path": "C:\Users\xxx\AppData\Local\Temp\identity-api_out_80dce640-5654-4d08-abc6-435287cc0eed", "error": "remove C:\Users\xxx\AppData\Local\Temp\identity-api_out_80dce640-5654-4d08-abc6-435287cc0eed: The process cannot access the file because it is being used by another process."}
image

EXPECTED
There are no errors in Debug Console.

Make URLs pretty

  • Make URLs lowercase
  • Simplify some of the catalog URL patterns

Reconsider when EF schema migrations are applied

From @bricelam

Today, database schema migrations are applied as certain components start up. This is problematic when multiple components (or multiple instances of the same component) use the same database.

Currently, for example, Ordering.BackgroundTasks immediately begins querying the OrderingDB database. This continually fails while waiting for Ordering.API to create and migrate the database schema to the latest version.

Data seeding (#10) should also be done at the same time.

Accessibility pass

We need to do an accessibility pass. @3lcarry will be handling this.

A couple of known issues:

  • Missing tooltips when hovering over the user/cart icons.
  • Footer text is blocked by banner image when looking at the identity page.

Turn on nullable reference types

  • Basket.API
  • Catalog.API
  • ClientApp
  • EventBus
  • EventBusRabbitMQ
  • HybridApp
  • Identity.API
  • IntegrationEventLogEF
  • Ordering.API
  • Ordering.BackgroundTasks
  • Ordering.Domain
  • Ordering.Infrastructure
  • Payment.API
  • Shared
  • WebApp
  • WebAppComponents
  • WebClient
  • Webhooks.API
  • eShop.AppHost
  • eShop.ServiceDefaults

[WebToolsE2E][Aspire] Clicking the "webhooksclient" endpoint and then logging in to order management failed: "invalid_request".

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 P1 from build [34310.174.d17.9]
  3. Install latest 8.0 SDK: 8.0.100
  4. Apply NuGet Feeds
  5. Install Docker Desktop

REPRO STEPS

  1. In the VS, clone the eShop repository and open eShop.Web.slnf
  2. F5 / Ctrl-F5, maybe you will encounter this issue #66
  3. Click Endpoint for 'webhooksclient'
  4. Click 'Log in' button

ACTUAL
Sorry, there was an error: invalid_request
Invalid redirect_uri
Animation

EXPECTED

Login successful.

Pick a consistent name for the shopping cart/bag/basket

From @danroth27:

We should pick a consistent name for the shopping cart/bag/basket.

Currently we have Basket.API, Cart.razor, and user facing text that says, "Your shopping bag".

From @SteveSandersonMS:

The user-facing text is all consistent on "shopping bag".

In the code, WebApp uses the term Cart, and the underlying service uses the term Basket. So those are indeed inconsistent, but in a way that is sort of valid - nothing strictly requires them to use the same term even though it would be better if they did.

Add items to cart without logging in

Every online store I've used allows anonymously adding items to a shopping cart and then prompts for login during check out. Unusually, eshop requires logging in before adding items to the cart. I think the demo should follow the usual rules for websites.

Was this done for technical reasons? i.e. tracking cart items against an account, or to show off requiring auth in the cart APIs

[Big Rock] Fix tests in eShop repo

  • Address failures with Catalog.UnitTests (action: delete these)
  • Address failures with Catalog.FunctionalTests (action: figure out how to use Aspire components/testconstainers in testing)
  • Address failures with Ordering.FunctionalTests (action: figure out how to use Aspire components/testcontainers in testing)
  • Address failures with Ordering.UnitTests (action: upgrade to test minimal API)
  • Address failures with Basket.UnitTests (action: need to be updated to unit test gRPC service)
  • Address failures with Basket.FunctionalTests (action: figure out how to use Aspire components/testcontainers in testing)
  • Address failures in Application.FunctionalTests (action: figure out if functional test setup used for other tests applies here)

The build failed

dotnet run --project src/eShop.AppHost/eShop.AppHost.csproj
Building...
/.nuget/packages/grpc.tools/2.59.0/build/_protobuf/Google.Protobuf.Tools.targets(291,5): error MSB6003: The specified task executable "/.nuget/packages/grpc.tools/2.59.0/tools/macosx_x64/protoc" could not be run. System.ComponentModel.Win32Exception (13): An error occurred trying to start process '/.nuget/packages/grpc.tools/2.59.0/tools/macosx_x64/protoc' with working directory '/data/eShop/src/Basket.API'. Permission denied [/data/eShop/src/Basket.API/Basket.API.csproj]
/.nuget/packages/grpc.tools/2.59.0/build/_protobuf/Google.Protobuf.Tools.targets(291,5): error MSB6003: at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) [/data/eShop/src/Basket.API/Basket.API.csproj]
/.nuget/packages/grpc.tools/2.59.0/build/_protobuf/Google.Protobuf.Tools.targets(291,5): error MSB6003: at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) [/data/eShop/src/Basket.API/Basket.API.csproj]
/.nuget/packages/grpc.tools/2.59.0/build/_protobuf/Google.Protobuf.Tools.targets(291,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [/data/eShop/src/Basket.API/Basket.API.csproj]
/.nuget/packages/grpc.tools/2.59.0/build/_protobuf/Google.Protobuf.Tools.targets(291,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.Execute() [/data/eShop/src/Basket.API/Basket.API.csproj]
/.nuget/packages/grpc.tools/2.59.0/build/_protobuf/Google.Protobuf.Tools.targets(291,5): error MSB6003: The specified task executable "/.nuget/packages/grpc.tools/2.59.0/tools/macosx_x64/protoc" could not be run. System.ComponentModel.Win32Exception (13): An error occurred trying to start process '/.nuget/packages/grpc.tools/2.59.0/tools/macosx_x64/protoc' with working directory '/data/eShop/src/WebApp'. Permission denied [/data/eShop/src/WebApp/WebApp.csproj]
/.nuget/packages/grpc.tools/2.59.0/build/_protobuf/Google.Protobuf.Tools.targets(291,5): error MSB6003: at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) [/data/eShop/src/WebApp/WebApp.csproj]
/.nuget/packages/grpc.tools/2.59.0/build/_protobuf/Google.Protobuf.Tools.targets(291,5): error MSB6003: at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) [/data/eShop/src/WebApp/WebApp.csproj]
/.nuget/packages/grpc.tools/2.59.0/build/_protobuf/Google.Protobuf.Tools.targets(291,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [/data/eShop/src/WebApp/WebApp.csproj]
/.nuget/packages/grpc.tools/2.59.0/build/_protobuf/Google.Protobuf.Tools.targets(291,5): error MSB6003: at Microsoft.Build.Utilities.ToolTask.Execute() [/data/eShop/src/WebApp/WebApp.csproj]

The build failed. Fix the build errors and run again.

Assets file 'C:\Users\User\Downloads\eShop-main\src\WebApp\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. WebApp C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 266

few error when load the project. try to acces nuget seem not authorise.
other error Assets file 'C:\Users\User\Downloads\eShop-main\src\EventBusRabbitMQ\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
EventBusRabbitMQ C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 266

Domain events should be published utill there are no more left

Current implementation of eShop.Ordering.Infrastructure.MediatorExtension.DispatchDomainEventsAsync
will check tracked entities and publish all domain event those entices hold once, which triggers domain event handlers to handle published events.
However, in real world applications, domain event handlers might also cause new domain events generated, and in current implementation new created domain events will be ignored.

I wrote this implementation that will keep publishing created domain events from tracked entires recursively, utill there are no more left. Please consider.

static class MediatorExtension
{
    public static async Task DispatchDomainEventsAsync(this IMediator mediator, OrderingContext ctx)
    {
        bool remains = true;
        while(remains) {
            var publishedCount = await DispatchDomainEventsRecursivelyAsync(mediator, ctx);
            remains = publishedCount > 0;
        }
    }

    private static async Task<int> DispatchDomainEventsRecursivelyAsync(this IMediator mediator, OrderingContext ctx)
    {
        var domainEntities = ctx.ChangeTracker
            .Entries<Entity>()
            .Where(x => x.Entity.DomainEvents != null && x.Entity.DomainEvents.Any());

        var domainEvents = domainEntities
            .SelectMany(x => x.Entity.DomainEvents)
            .ToList();
        int count = domainEvents.Count;

        domainEntities.ToList()
            .ForEach(entity => entity.Entity.ClearDomainEvents());
        
        foreach (var domainEvent in domainEvents)
            await mediator.Publish(domainEvent);
        
        return count;
    }
}

Would be happy to create the PR.

Share integration events between projects

From @ReubenBond:

Currently, there are many integration events which have duplicated representations across projects, which makes the complex Order processing flow even more complex because developers cannot use tooling to find usages of the integration event types.

Instead, let's use one or more shared projects to describe these events so that FindAllReferences/etc work.

[WebToolsE2E][Aspire] The black area behind the shopping bag is too small, resulting in poor readability of the number of shopping bags.

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 P1 from build [34303.117.d17.9]
  3. Install latest 8.0 SDK: 8.0.100
  4. Apply NuGet Feeds
  5. Install Docker Desktop

REPRO STEPS

  1. In the VS, clone the eShop repository and open eShop.Web.slnf
  2. F5 / Ctrl-F5
  3. Click Endpoint for 'webapp'
  4. Log in to cart and add any item to cart
  5. Change the quantity to '8888' then click Update

ACTUAL

The black area is too small, resulting in poor readability of the number of shopping bags.
image

EXPECTED

image

[WebToolsE2E][Aspire] After running the eshop.web solution, some rabbitMQ error logs appeared in the structured logs: "Unexpected connection closure: AMQP close-reason."

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 P1 from build [34309.102.d17.9]
  3. Install latest 8.0 SDK: 8.0.100
  4. Apply NuGet Feeds
  5. Install Docker Desktop

REPRO STEPS

  1. In the VS, clone the eShop repository and open eShop.Web.slnf
  2. F5 / Ctrl-F5
  3. There are some rabbitMQ error logs 'Unexpected connection closure: AMQP close-reason' in Structured Logs

ACTUAL
Unexpected connection closure: AMQP close-reason, initiated by Library, code=0, text='End of stream', classId=0, methodId=0, cause=System.IO.EndOfStreamException: Reached the end of the stream. Possible authentication failure.
at RabbitMQ.Client.Impl.InboundFrame.ReadFrom(Stream reader, Byte[] frameHeaderBuffer, ArrayPool`1 pool, UInt32 maxMessageSize)
at RabbitMQ.Client.Impl.SocketFrameHandler.ReadFrame()
at RabbitMQ.Client.Framing.Impl.Connection.MainLoopIteration()
at RabbitMQ.Client.Framing.Impl.Connection.MainLoop()
image

EXPECTED
There are no errors in Structured Logs.

Remove DDD boilerplate

From @bricelam:

It is the professional opinion of the EF team that the DDD patterns employed in the Ordering.API and related projects are of no value (and possibly even result in negative value) and can safely be removed for the sake of maintainability.

This includes, but is not limited to:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.