From the course: Expert Domain-Driven Design (DDD) Implementation in .NET
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Persisting data in the ManagementApplicationService class - .NET Tutorial
From the course: Expert Domain-Driven Design (DDD) Implementation in .NET
Persisting data in the ManagementApplicationService class
- [Instructor] Up to now, we have the management application service class, where we're injecting the IBreedService as part of its primary structure. Additionally, we registered the concrete implementation of IBreedService into dependence injection container, and we're using the IBreedService object to create a fully validated breed ID object. Now what about persistence? As I've mentioned before, some people choose to use a repository object, but instead we'll inject the DB context right here. So management Db context, and let's name it dbContext. And let's wrap every parameter, just like this. And here, let's use dbContext and then Pets AddAsync newPet and let's wait for this. And finally SaveChangesAsync. Okay, now we need to register management application service in the dependence injection container as well. So let's open up program. And here, let's type builder services, and then add scope, Management ApplicationService. And since we don't have an interface, we can register the…
Contents
-
-
-
-
-
-
(Locked)
Implementing the ManagementApplicationService class5m 26s
-
(Locked)
Persisting data in the ManagementApplicationService class3m 52s
-
(Locked)
Rehydrating persisted entities and invoking their behavior3m 47s
-
(Locked)
Creating a command handler interface for handling commands3m 36s
-
(Locked)
Challenge: Implementing the Clinic API2m 7s
-
(Locked)
Solution: Implementing the Clinic API3m 42s
-
(Locked)
Challenge: Refactoring the consultation date and time57s
-
(Locked)
Solution: Refactoring the consultation date and time4m 43s
-
(Locked)
-
-
-