onion-architecture

Decoupling ASP.NET Identity from the Core Domain Models - Onion Architecture

|▌冷眼眸甩不掉的悲伤 提交于 2020-07-04 06:29:11
问题 I am using this sample project (https://github.com/imranbaloch/ASPNETIdentityWithOnion) as my application architecture, in this sample the core is completly decoplied from the infrastrure including the identity framework. In this sample the author has used the adapter pattern to decouple core identity classes (IdentityUser, IdentityRole ... ) and provide classes like them in the Core layer. Now the issue in this sample project is that the Domain model (Product, Images) are not linked with the

Onion Architecture Identity Framework

柔情痞子 提交于 2020-05-27 09:28:04
问题 I am following Onion Architecture. And in that I am using ASP.NET Identity Framework. Here is my Project Structure: 1-Core - Domain Classes //It contains my T4 template classes -- AppUser //It is Identity User. - Repository Interfaces - Service Interfaces 2-Infrastructure - Data //It contains my edmx file, I am using Db First approach. - Dependency Injection - Repository Interfaces Implementation - Service Interfaces Implementation 3-WebApi - Web Api Project 4-WebClient - My AngularJs App 5

Onion Architecture : Can UI depend on Domain

泪湿孤枕 提交于 2019-12-31 03:37:23
问题 I am making an ASP.NET MVC website with an Onion architecture. I have implemented a repository pattern and am now creating a Controller method in my project. This is my architecture: Domain : Entities / Domain Interfaces Repository : Generic repository (for now) using Entity Framework Code First Service : Generic Service that calls the Repository MVC Now in my MVC project I need to access repository but according to Jeffrey Palermo, MVC is dependant from Service and Domain, but nothing is

Bounded context implementation and design

╄→尐↘猪︶ㄣ 提交于 2019-12-20 09:04:21
问题 Let's say I have two bounded contexts, the Shipping Context and the Billing Context . Each of these contexts need to know about the customer. At a data level, the customer is represented by a CustomerTbl table in a database. This table consists of all the necessary columns that describe the customer. Columns in CustomerTbl (simplified): Name PhysicalAddress PaymentMethod The Shipping Context is concerned with Name and PhysicalAddress while the Billing Context is concerned with Name and

Opinion on ASP.NET MVC Onion-based architecture

£可爱£侵袭症+ 提交于 2019-12-20 08:07:20
问题 What is your opinion on the following 'generic' code-first Onion-inspired ASP.NET MVC architecture: The layers, explained: Core - contain the Domain model. e.g. that's the business objects and their relationship. I am using Entity Framework to visually design the entities and the relations between them. It lets me generate a script for a database. I am getting automatically-generated POCO-like models, which I can freely refer to in the next layer (Persistence), since they are simple (i.e.

Best Way to Decouple Startup Configuration from Web Project in ASP.NET 5 and MVC 6

China☆狼群 提交于 2019-12-18 13:38:02
问题 Using MVC5, it has been very easy to create a bootstrapper project that had references to all layers, thus decoupling the UI layer from references to, lets say, infrastructure logic. The project would contain startup configuration logic, such as setting up the IoC container. The way to do this was to define a startup class: public class Startup { public static void Start() { // startup configuration (IoC etc) goes here } } And then add a line in AssemblyInfo.cs : [assembly:

Generic repository to update an entire aggregate

血红的双手。 提交于 2019-12-17 22:51:37
问题 I am using the repository pattern to provide access to and saving of my aggregates. The problem is the updating of aggregates which consist of a relationship of entities. For example, take the Order and OrderItem relationship. The aggregate root is Order which manages its own OrderItem collection. An OrderRepository would thus be responsible for updating the whole aggregate (there would be no OrderItemRepository ). Data persistence is handled using Entity Framework 6. Update repository method

Onion Architecture- Entity Framework Code First Models DataAnnotations

泪湿孤枕 提交于 2019-12-17 18:43:51
问题 I am developing a ASP.NET MVC Project following the Onion Architecture. I have added the Models inside my Core Project and these Models will be referred as the POCO classes for the Entity Framework Models in the Infrastructure Project. My question is how can I add Data Annotations Which depends on the Entity Framework? Can I make the Core Models as Interfaces and inherit it in the Infrastructure Projects and do real Implementation? 回答1: You don't need to create Core Models as Interfaces if

Unity: Implicit ResolvedParameter for unnamed registrations

有些话、适合烂在心里 提交于 2019-12-17 18:30:13
问题 The UserService constructor has two parameters, a IUnitOfWork and a IUserRepository : public UserService(IUnitOfWork unitofWork, IUserRepository userRepository) { ... } I am using named registrations to differentiate between multiple instances of IUnitOfWork , so when registering the UserService with the Unity container, I need to explicitly specify the parameters using an InjectionConstructor : container.RegisterType<IUserService, UserService>( new InjectionConstructor( new ResolvedParameter

Infrastructure mobility via Onion architecture - practical implications

可紊 提交于 2019-12-11 09:37:53
问题 One of the key benefits provided by Onion architecture is the ability to swap out "infrastructure" elements, such as "Data Access, I/O, and Web Services" (http://jeffreypalermo.com/blog/the-onion-architecture-part-3/). Jeff says in his post from 2008 that "the industry has modified data access techniques at least every three years". Does anyone have an example of a reasonably large project where Onion architecture was used and swapping out of key infrastructure elements was subsequently