Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PositionApiResult"/> class.
 /// </summary>
 /// <remarks>
 /// Constructor that accepts a <see cref="Position"/> parameter.
 /// </remarks>
 /// <param name="_position">A <see cref="Position"/>.</param>
 public PositionApiResult(Position _position)
 {
     PositionId = _position.PositionId;
     Name       = _position.Name;
     IsManager  = _position.IsManager;
     IsUnique   = _position.IsUnique;
     Callsign   = _position.Callsign;
     Component  = new SubComponentApiResult(_position.ParentComponent);
     Members    = _position.Members.ToList().ConvertAll(x => new SubMemberApiResult(x));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ComponentApiResult"/> class.
 /// </summary>
 /// <param name="_component">The <see cref="Component"/> class object from which the <see cref="ComponentApiResult"/> object will be constructed.</param>
 public ComponentApiResult(Component _component)
 {
     ComponentId = _component?.ComponentId;
     Name        = _component?.Name ?? "";
     Acronym     = _component?.Acronym ?? "";
     if (_component?.ParentComponent != null)
     {
         ParentComponent = new SubComponentApiResult(_component.ParentComponent);
     }
     if (_component?.Positions != null)
     {
         Positions = _component.Positions.ToList().ConvertAll(x => new PositionApiResult(x));
     }
 }