1

I have something like this

public class Item
{
   public string FirstName { get; set; }
   public string LastName { get; set; }
   public int ID { get; set; }
}

public class Data
{
    public List<Item> Items { get; set; }
}

enter image description here

what is right type of relationsheeps between them? Dependency?

A191919
  • 3,422
  • 7
  • 49
  • 93

2 Answers2

2

You are right - Data is dependent on Item, since it "owns" many Items. This is a form of aggregation.

This is the arrow you are searching for:

         0..*     0..*
| Data | <>―――――――> | Item |

enter image description here

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
Binkan Salaryman
  • 3,008
  • 1
  • 17
  • 29
0

I don't know what your model means, but here is a version of it in normal UML 2:

enter image description here

If I were you, I would put a property on both ends of the association and give each one a semantically strong name. For example, describedItems and describingData. Please see how to indicate a list of types in UML and this answer on association ends.

Community
  • 1
  • 1
Jim L.
  • 6,177
  • 3
  • 21
  • 47