2using System.Collections.Generic;
4using System.Runtime.Serialization;
14 #region Private Attributes
19 public LayerViewsDefault() : base(
true) { }
21 public override object GetDefaultValue(
object owner)
24 return new HashSet<IReference<ILayerView>>(
25 portfolio_view.portfolio.GetValue().layers.Select(lyr_ref =>
26 LayerViews.Create(lyr_ref.GetValue(), portfolio_view.analysis_profile)
27 .Post().ToReference()));
28 throw new NotSupportedException(
"A PortfolioView instance that contains a " +
29 "reference to a Portfolio must be supplied to determine what its default " +
30 "layer_views collection would be.");
33 #endregion Private Attributes
35 #region APIResource Interface Members
42 #endregion APIResource Interface Members
44 #region Public Properties
54 [DataMember(Order = 21)]
56 public HashSet<IReference<ILayerView>>
layer_views {
get;
set; }
60 [DataMember(Order = 22)]
64 [DataMember(Order = 23)]
67 #endregion Public Properties
73 layer_views =
new HashSet<IReference<ILayerView>>();
88 layerViewsToAdd, layerViewsToRemove, timeout: timeout);
PortfolioView and LayerView abstract base class.
Represents the endpoint on the server for requesting marginal portfolios.
static IReference< PortfolioView > Post(IReference< PortfolioView > basePortfolio, IEnumerable< IReference< ILayerView > > layerViewsToAdd=null, IEnumerable< IReference< ILayerView > > layerViewsToRemove=null, IEnumerable< Parameter > requestParameters=null, int? timeout=null)
Construct a "marginal" PortfolioView by adding and/or removing one or more LayerViews to/from some ba...
API methods / requests made available to the user.
Specifies that a property is generated by the server and should not be specified on the client side d...
Indicates that the property, if left null, will have a default value generated and filled in by the s...
Representation of a monetary value with a currency.
Represents the Analysis of a Portfolio.
override string collection_name
The collection endpoint at which resources of this type reside on the server.
static readonly string CLASS_COLLECTION_NAME
The collection endpoint at which resources of this type reside on the server.
PortfolioView()
Construct a new PortfolioView with an empty layer_views HashSet and a reference to the default Analys...
IReference< StaticPortfolio > portfolio
The portfolio from which this portfolioView was constructed. Can be supplied by the user on POST inst...
HashSet< IReference< ILayerView > > layer_views
The LayerViews included in this PortfolioView. Must be supplied when posting a new PortfolioView,...
IReference< PortfolioView > PostMarginalPortfolio(IEnumerable< IReference< ILayerView > > layerViewsToAdd=null, IEnumerable< IReference< ILayerView > > layerViewsToRemove=null, int? timeout=null)
Construct a new "marginal" PortfolioView by adding and/or removing one or more LayerViews to/from thi...
MonetaryUnit premium
The computed premium of this portfolio.
Base interface for all reference entities.