c# - Aggregate root and Entity Framework -


I am overall struggling with the net implementation of the root, in which the unit framework code is the first one. Suppose we have a standard problem of order and order item, which is the origin of the former. We keep a stored archive of order-item items in the order class so that we can control (by combining) the total route (i.e. order orbit) in order to add, remove or update order items (by design).

  1. How do we implement this list of OrderItem (S)? This list needs to be read-only so that other developers do not try to add order item (s) to the list by hand, instead of using the methods used.

  2. How do we mark that collection before EF code? Private assets are unavailable.

    1. How do we order it ) Apply this list? This list needs to be read-only so that other developers do not try to add order eggs (S) within the list in order, instead, avoid those methods which should be used instead.

      A reading list will not prevent other developers from adding and removing objects for it. It will only prevent the change of order item's reference pointer.

      What you can do is make the list private, and a method for order AddItem, RemoveItem and UpdateItem and an IEnumerable getter for recurrence purposes.

      1. How do we map that archive into the EF code? Private properties can not be matched. I have never used EF, but before doing some DDD, it is useful to have a group of organizations for your application and logic, your real domain model And another set of institutions for your Data Access Framework, in this case EF. Use something like Automapor to map your EF organizations with your domain entities.

        You do not always have two set units, but for those who are problematic in this way, the unit wants EF, and add an additional step to the object's object from the object.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -