-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.json
162 lines (162 loc) · 136 KB
/
index.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
{
"api/DynamicVML.AddNewDynamicItem.html": {
"href": "api/DynamicVML.AddNewDynamicItem.html",
"title": "Class AddNewDynamicItem | DVML",
"keywords": "Class AddNewDynamicItem Represents the data object that the client can send to the server to request a new partial view for a new list item using ajax. When the controller creates this new partial view, an instance of this class will be stored in the ViewDataDictionary object of the views under the key ItemCreateParameters . Inheritance Object AddNewDynamicItem Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML Assembly : DynamicVML.dll Syntax public class AddNewDynamicItem Remarks An instance of this class should be specified as the single argument of the controller action that should handle the creation of a new item in your application. In addition, your controller action must end by calling one of the PartialView(Controller, IDynamicList, AddNewDynamicItem) overloads that will take care of rendering the new item for you. An example can be seen below: [HttpGet] public IActionResult AddBook(AddNewDynamicItem parameters) { var newBookViewModel = new BookViewModel() { Title = \"New book\", PublicationYear = \"1994\" }; return this.PartialView(newBookViewModel, parameters); } Note Under normal circumstances, this class should never need to be instantiated directly by your code as it is part of the inner workings of the library. Constructors | Improve this Doc View Source AddNewDynamicItem() Creates a new instance of the AddNewDynamicItem class. This is an empty constructor that is necessary to be present in order for IModelBinder deserialize objects of this class correctly. Declaration public AddNewDynamicItem() | Improve this Doc View Source AddNewDynamicItem(String, String, String, String, String, ListRenderMode, Object) Creates a new instance of AddNewDynamicItem . Declaration public AddNewDynamicItem(string containerId, string listTemplate, string itemContainerTemplate, string itemTemplate, string prefix, ListRenderMode mode, object additionalViewData) Parameters Type Name Description String containerId String listTemplate String itemContainerTemplate String itemTemplate String prefix ListRenderMode mode Object additionalViewData Properties | Improve this Doc View Source AdditionalViewData Gets or sets any additional view data which may have been passed by the user when calling the ListEditorFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, String, String, Object, ListRenderMode, NewItemMethod) extension method, represented by an UTF-8 byte array that can be serialized to JSON and posted back to the server. Declaration public byte[] AdditionalViewData { get; set; } Property Value Type Description Byte [] | Improve this Doc View Source ContainerId Gets or sets the HTML div ID for the list whose new item should be created for. Declaration public string ContainerId { get; set; } Property Value Type Description String | Improve this Doc View Source DisableTraceWarningsForQueryStringsThatContainAdditionalViewData Self explanatory. Declaration public static bool DisableTraceWarningsForQueryStringsThatContainAdditionalViewData { get; set; } Property Value Type Description Boolean Remarks By default, the library will generate a TraceWarning(String) if you specify any additionalViewData to the ListEditorFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, String, String, Object, ListRenderMode, NewItemMethod) method while also specifying the HTTP method as Get . Setting this static property to false will disable those warnings globally. | Improve this Doc View Source ItemContainerTemplate Gets or sets the ItemContainerTemplate to be used when creating the new item. Declaration public string ItemContainerTemplate { get; set; } Property Value Type Description String | Improve this Doc View Source ItemTemplate Gets or sets the ItemTemplate to be used when creating the new item. Declaration public string ItemTemplate { get; set; } Property Value Type Description String | Improve this Doc View Source ListTemplate Gets or sets the ListTemplate to be used when creating the new item. Declaration public string ListTemplate { get; set; } Property Value Type Description String | Improve this Doc View Source Mode Gets or sets the ListRenderMode to be used when creating the new item. Declaration public ListRenderMode Mode { get; set; } Property Value Type Description ListRenderMode | Improve this Doc View Source Prefix Gets or sets the HTML prefix to be used when creating the new item. Declaration public string Prefix { get; set; } Property Value Type Description String Methods | Improve this Doc View Source GetAdditionalViewData() Gets the additional view data at AdditionalViewData as a Dictionary<TKey,TValue> containing the key-value pairs in the AdditionalViewData . Declaration public Dictionary<string, string> GetAdditionalViewData() Returns Type Description Dictionary < String , String > A Dictionary<TKey,TValue> representing the contents of the AdditionalViewData property of this class. | Improve this Doc View Source ToJSON() Converts this instance to a JSON representation that can be sent to the server. Declaration public string ToJSON() Returns Type Description String A JSON containing the key-value pairs of the properties of this class. | Improve this Doc View Source ToQueryString() Converts this instance to a GET query string representation that can be sent to the server. Declaration public string ToQueryString() Returns Type Description String An HTTP GET query string containing the key-value pairs of the properties of this class, e.g.: \"?containerId=SgDdaDhJ&prefix=MyForm.MyProperty&ListTemplate=MyTemplate\" Remarks Warning Additional user data is never included in the query string. See ListEditorFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, String, String, Object, ListRenderMode, NewItemMethod) for more details. Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>)"
},
"api/DynamicVML.DynamicList-1.html": {
"href": "api/DynamicVML.DynamicList-1.html",
"title": "Class DynamicList<TViewModel> | DVML",
"keywords": "Class DynamicList<TViewModel> Represents a list of view model objects that can be added and removed from a form through Ajax. This class can be used to create lists of view models that contain no custom options. To specify custom options for your objects, see DynamicList<TViewModel, TOptions> . Inheritance Object DynamicList <TViewModel, DynamicListItem <TViewModel>> DynamicList<TViewModel> Implements ICollection < DynamicListItem <TViewModel>> IEnumerable < DynamicListItem <TViewModel>> IEnumerable IDynamicList < DynamicListItem <TViewModel>> IDynamicList Inherited Members DynamicList<TViewModel, DynamicListItem<TViewModel>>.Dictionary DynamicList<TViewModel, DynamicListItem<TViewModel>>.CreateId() DynamicList<TViewModel, DynamicListItem<TViewModel>>.Keys DynamicList<TViewModel, DynamicListItem<TViewModel>>.ViewModels DynamicList<TViewModel, DynamicListItem<TViewModel>>.Options DynamicList<TViewModel, DynamicListItem<TViewModel>>.ContainerId DynamicList<TViewModel, DynamicListItem<TViewModel>>.Index DynamicList<TViewModel, DynamicListItem<TViewModel>>.Count DynamicList<TViewModel, DynamicListItem<TViewModel>>.IsReadOnly DynamicList<TViewModel, DynamicListItem<TViewModel>>.Item[String] DynamicList<TViewModel, DynamicListItem<TViewModel>>.AddRange(IEnumerable<DynamicListItem<TViewModel>>) DynamicList<TViewModel, DynamicListItem<TViewModel>>.AddRange(IEnumerable<TViewModel>, Func<TViewModel, DynamicListItem<TViewModel>>) DynamicList<TViewModel, DynamicListItem<TViewModel>>.Add(DynamicListItem<TViewModel>) DynamicList<TViewModel, DynamicListItem<TViewModel>>.Add(TViewModel) DynamicList<TViewModel, DynamicListItem<TViewModel>>.Add(TViewModel, Action<DynamicListItem<TViewModel>>) DynamicList<TViewModel, DynamicListItem<TViewModel>>.Clear() DynamicList<TViewModel, DynamicListItem<TViewModel>>.Contains(DynamicListItem<TViewModel>) DynamicList<TViewModel, DynamicListItem<TViewModel>>.CopyTo(DynamicListItem<TViewModel>[], Int32) DynamicList<TViewModel, DynamicListItem<TViewModel>>.Remove(DynamicListItem<TViewModel>) DynamicList<TViewModel, DynamicListItem<TViewModel>>.GetEnumerator() DynamicList<TViewModel, DynamicListItem<TViewModel>>.IEnumerable.GetEnumerator() DynamicList<TViewModel, DynamicListItem<TViewModel>>.ToModel<TModel>(Func<TViewModel, TModel>) DynamicList<TViewModel, DynamicListItem<TViewModel>>.ToModel<TModel>(Func<DynamicListItem<TViewModel>, TModel>) DynamicList<TViewModel, DynamicListItem<TViewModel>>.IDynamicList<DynamicListItem<TViewModel>>.Item[String] DynamicList<TViewModel, DynamicListItem<TViewModel>>.IDynamicList.Item[String] Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML Assembly : DynamicVML.dll Syntax public class DynamicList<TViewModel> : DynamicList<TViewModel, DynamicListItem<TViewModel>>, ICollection<DynamicListItem<TViewModel>>, IEnumerable<DynamicListItem<TViewModel>>, IEnumerable, IDynamicList<DynamicListItem<TViewModel>>, IDynamicList where TViewModel : class Type Parameters Name Description TViewModel The type of the view model. Constructors | Improve this Doc View Source DynamicList() Initializes a new instance of the DynamicList<TViewModel, TOptions> class. Declaration public DynamicList() | Improve this Doc View Source DynamicList(String) Initializes a new instance of the DynamicList<TViewModel, TOptions> class. This constructor overload is only used when creating a new item to be added to an existing form in an HTML page. Declaration public DynamicList(string containerId) Parameters Type Name Description String containerId The ID of the HTML div element to which the contents of this list should be appended to. Implements System.Collections.Generic.ICollection<T> System.Collections.Generic.IEnumerable<T> System.Collections.IEnumerable IDynamicList<TValue> IDynamicList Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(IEnumerable<TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(IEnumerable<TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(IEnumerable<TViewModel>, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(IEnumerable<TModel>, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(IEnumerable<TModel>, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(IEnumerable<TModel>, Func<TModel, TOptions>) See Also DynamicList <TViewModel, TOptions>"
},
"api/DynamicVML.DynamicList-2.html": {
"href": "api/DynamicVML.DynamicList-2.html",
"title": "Class DynamicList<TViewModel, TOptions> | DVML",
"keywords": "Class DynamicList<TViewModel, TOptions> Represents a list of view model objects that can be added and removed from a form through Ajax. This class can be used to create lists of view models that contain custom options for your items. Inheritance Object DynamicList<TViewModel, TOptions> DynamicList <TViewModel> Implements ICollection <TOptions> IEnumerable <TOptions> IEnumerable IDynamicList <TOptions> IDynamicList Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML Assembly : DynamicVML.dll Syntax public class DynamicList<TViewModel, TOptions> : ICollection<TOptions>, IEnumerable<TOptions>, IEnumerable, IDynamicList<TOptions>, IDynamicList where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Type Parameters Name Description TViewModel The type of the view model. TOptions The options class type containing the additional options you might want to specify, e.g., \"Title\", or \"Subtitle\". Remarks This class implements ICollection<T> , ICollection<T> , IDynamicList<TValue> , and IDynamicList . This class represents a list of HTML elements, but is actually implemented as a Dictionary<TKey,TValue> of unique div HTML element IDs and their associated objects and the ViewModel contained inside them. Note If you see yourself implementing many properties in your view model using this class, you might notice that your properties' type names will start to look a bit too long. In that case, you can subclass DynamicList<TViewModel, TOptions> and create a type that either always implements your custom options, or always use your desired view model. You can then use this subclass in as the property type of your view model collections instead of DynamicList<TViewModel, TOptions> . This should reduce the length of your property names significantly. Constructors | Improve this Doc View Source DynamicList() Initializes a new instance of the DynamicList<TViewModel, TOptions> class. Declaration public DynamicList() | Improve this Doc View Source DynamicList(String) Initializes a new instance of the DynamicList<TViewModel, TOptions> class. This constructor overload is only used when creating a new item to be added to an existing form in an HTML page. Declaration public DynamicList(string containerId) Parameters Type Name Description String containerId The ID of the HTML div element to which the contents of this list should be appended to. Properties | Improve this Doc View Source ContainerId The HTML div ID associated with this list. This ID is generated automatically using CreateId() and is guaranteed to be unique. Declaration public string ContainerId { get; set; } Property Value Type Description String The identifier for the HTML div element that contains the representation of this list in an HTML form. | Improve this Doc View Source Count Gets the number of elements contained in this list. Declaration public int Count { get; } Property Value Type Description Int32 The number of elements in this list. | Improve this Doc View Source Dictionary Gets or sets the internal dictionary that is used to store by their HTML div id key. Declaration protected Dictionary<string, TOptions> Dictionary { get; set; } Property Value Type Description Dictionary < String , TOptions> | Improve this Doc View Source Index This property is required to help IModelBinder during runtime and does not have to be set to anything when creating the list. Declaration public string Index { get; set; } Property Value Type Description String | Improve this Doc View Source IsReadOnly Gets a value indicating whether this ICollection<T> is read-only. In the case of a DynamicList<TViewModel, TOptions> , it should always return false. Declaration public bool IsReadOnly { get; } Property Value Type Description Boolean Always false. | Improve this Doc View Source Item[String] Gets the object associated with the specified HTML div ID. Your view models are contained inside the object. Declaration public TOptions this[string id] { get; } Parameters Type Name Description String id The HTML div id for the element you want to retrieve. Property Value Type Description TOptions The object containing your ViewModel plus any additional options associated to it. | Improve this Doc View Source Keys Gets an enumerable that can be used to iterate through the identifiers of the div HTML elements used by your view models when rendered in a form. Declaration public IEnumerable<string> Keys { get; } Property Value Type Description IEnumerable < String > The keys, represented as an IEnumerable<T> . | Improve this Doc View Source Options Gets an enumerable that can be used to iterate through the Option objects associated with each of your ViewModel objects contained in this list. An Options object contains at least a property called \"Index\" which is necessary for ASP.NET's IModelBinder to work. Declaration public IEnumerable<TOptions> Options { get; } Property Value Type Description IEnumerable <TOptions> The view models, represented as an IEnumerable<T> . | Improve this Doc View Source ViewModels Gets an enumerable that can be used to iterate through your ViewModel objects that may be contained in this list. Declaration public IEnumerable<TViewModel> ViewModels { get; } Property Value Type Description IEnumerable <TViewModel> The view models, represented as an IEnumerable<T> . Methods | Improve this Doc View Source Add(TViewModel) Adds the specified object to the list. The list will automatically create a object to wrap it and provide it with an unique ID. Declaration public TOptions Add(TViewModel viewModel) Parameters Type Name Description TViewModel viewModel The view model object to be added to this list. Returns Type Description TOptions | Improve this Doc View Source Add(TViewModel, Action<TOptions>) Adds the specified object to the list. The list will automatically create a object to wrap it and provide it with an unique ID. Declaration public TOptions Add(TViewModel viewModel, Action<TOptions> options) Parameters Type Name Description TViewModel viewModel The view model object to be added to this list. Action <TOptions> options A method that can be used to customize the TOptions object that will be used to wrap the viewModel before it gets added to the list. This can be used to specify custom IDs for list items. Returns Type Description TOptions | Improve this Doc View Source Add(TOptions) Adds the specified object to the list. The Index property of your options object may be changed by this method upon insertion. Declaration public void Add(TOptions options) Parameters Type Name Description TOptions options The options object to be added to this list. Remarks If an item with a duplicate key gets inserted to this list, it will replace the old one with this new instance. This is not the same behavior of a standard Dictionary<TKey,TValue> but is needed to avoid model binding errors since IModelBinder will call this method to reconstruct the DynamicList<TViewModel, TOptions> object from the user's HTTP request. | Improve this Doc View Source AddRange(IEnumerable<TViewModel>, Func<TViewModel, TOptions>) Adds multiple elements to this list. Note that, when added, the list may change properties of the object (but not of your view models). Declaration public void AddRange(IEnumerable<TViewModel> viewModels, Func<TViewModel, TOptions> options = null) Parameters Type Name Description IEnumerable <TViewModel> viewModels The view models to be added to this list. Func <TViewModel, TOptions> options A default creation function that can be used to specify options associated with each of your view models. This is optional. | Improve this Doc View Source AddRange(IEnumerable<TOptions>) Adds multiple elements to this list. Note that, when added, the list may change properties of the object (but not of your view models). Declaration public void AddRange(IEnumerable<TOptions> options) Parameters Type Name Description IEnumerable <TOptions> options The elements to be added to this list. | Improve this Doc View Source Clear() Removes all items from this list. Declaration public void Clear() | Improve this Doc View Source Contains(TOptions) Determines whether the this list contains a specific value. Note that only the Index property of the provided object will be used to determine whether the list contains a similar element or not. This method will not look into the actual contents of your options or view model. Declaration public bool Contains(TOptions item) Parameters Type Name Description TOptions item The object to locate in the list. Returns Type Description Boolean true if item is found in the list; otherwise, false . | Improve this Doc View Source CopyTo(TOptions[], Int32) Copies the elements of this list to an Array , starting at a particular Array index. Declaration public void CopyTo(TOptions[] array, int arrayIndex) Parameters Type Name Description TOptions[] array The one-dimensional Array that is the destination of the elements copied from ICollection<T> . The Array must have zero-based indexing. Int32 arrayIndex The zero-based index in array at which copying begins. | Improve this Doc View Source CreateId() This method creates an unique identified that can be used to identify HTML div elements in your form. Those IDs are needed in order to help ASP.NET's ASP.NET's IModelBinder bind the dynamic view models to your forms. Declaration protected static string CreateId() Returns Type Description String A string containing a GUID value in a HTML-friendly format. | Improve this Doc View Source GetEnumerator() Returns an enumerator that iterates through the collection. Declaration public IEnumerator<TOptions> GetEnumerator() Returns Type Description IEnumerator <TOptions> An enumerator that can be used to iterate through the collection. | Improve this Doc View Source Remove(TOptions) Removes the item with the same key specified in the Index property of the provided item . Declaration public bool Remove(TOptions item) Parameters Type Name Description TOptions item The object to remove from the list. Returns Type Description Boolean true if item was successfully removed from the list; otherwise, false . This method also returns false if item is not found in the original ICollection<T> . | Improve this Doc View Source ToModel<TModel>(Func<TViewModel, TModel>) Converts all view models stored inside this instance to their database model counterparts using the specified func . Declaration public IEnumerable<TModel> ToModel<TModel>(Func<TViewModel, TModel> func) Parameters Type Name Description Func <TViewModel, TModel> func A function that takes a and converts it to a . Returns Type Description IEnumerable <TModel> A IEnumerable<T> that can be materialized to an actual list/collection or just iterated over (e.g. using System.Linq . Type Parameters Name Description TModel The type for the models to convert to. | Improve this Doc View Source ToModel<TModel>(Func<TOptions, TModel>) Converts all view models stored inside this instance to their database model counterparts using the specified func . This overload can be used to take the options associated with each view model object into consideration during the conversion. Declaration public IEnumerable<TModel> ToModel<TModel>(Func<TOptions, TModel> func) Parameters Type Name Description Func <TOptions, TModel> func A function that takes a (which contains a ) and converts both to a . Returns Type Description IEnumerable <TModel> A IEnumerable<T> that can be materialized to an actual list/collection or just iterated over (e.g. using System.Linq . Type Parameters Name Description TModel The type for the models to convert to. Explicit Interface Implementations | Improve this Doc View Source IDynamicList.Item[String] Gets the with the specified identifier as an IDynamicListItem object. Declaration IDynamicListItem IDynamicList.this[string id] { get; } Parameters Type Name Description String id Returns Type Description IDynamicListItem Remarks This is an explicit interface implementation which is only available when interacting with this list through the IDynamicList interface. Normally, this should only be the case when accessing the list from a view. | Improve this Doc View Source IDynamicList<TOptions>.Item[String] Gets the with the specified identifier. Declaration TOptions IDynamicList<TOptions>.this[string id] { get; } Parameters Type Name Description String id Returns Type Description TOptions Remarks This is an explicit interface implementation which is only available when interacting with this list through the interface. Normally, this should only be the case when accessing the list from a view. | Improve this Doc View Source IEnumerable.GetEnumerator() Returns an enumerator that iterates through a collection. Declaration IEnumerator IEnumerable.GetEnumerator() Returns Type Description IEnumerator An IEnumerator object that can be used to iterate through the collection. Implements System.Collections.Generic.ICollection<T> System.Collections.Generic.IEnumerable<T> System.Collections.IEnumerable IDynamicList<TValue> IDynamicList Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(IEnumerable<TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(IEnumerable<TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(IEnumerable<TViewModel>, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(IEnumerable<TModel>, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(IEnumerable<TModel>, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(IEnumerable<TModel>, Func<TModel, TOptions>) See Also DynamicList <TViewModel> ICollection <T> IDynamicList <TValue> IDynamicList"
},
"api/DynamicVML.DynamicListItem-1.html": {
"href": "api/DynamicVML.DynamicListItem-1.html",
"title": "Class DynamicListItem<TViewModel> | DVML",
"keywords": "Class DynamicListItem<TViewModel> Represents a list item containing a TViewModel for the item and its associated options. Inheritance Object DynamicListItem<TViewModel> Implements IDynamicListItem <TViewModel> IDynamicListItem Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML Assembly : DynamicVML.dll Syntax public class DynamicListItem<TViewModel> : IDynamicListItem<TViewModel>, IDynamicListItem where TViewModel : class Type Parameters Name Description TViewModel The type of view model to be stored in this item. Properties | Improve this Doc View Source Index This property is needed by the IModelBinder in order to bind this item correctly to the HTML form. It does not have to be set manually and will likely be overwritten by the rest of the library. Declaration public string Index { get; set; } Property Value Type Description String The index of the item, represented as a GUID value formatted as a HTML-friendly string. | Improve this Doc View Source ViewModel Gets or sets the view model stored in this item. Declaration public TViewModel ViewModel { get; set; } Property Value Type Description TViewModel The view model. Explicit Interface Implementations | Improve this Doc View Source IDynamicListItem.ViewModel Gets the view model associated with this item as an object. Declaration object IDynamicListItem.ViewModel { get; } Returns Type Description Object The view model. Remarks This property is only visible when handling this item through the non-generic IDynamicListItem interface, which normally should be the case only when acessing this item from a view (e.g. list templates). Implements IDynamicListItem<TViewModel> IDynamicListItem Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) See Also IDynamicListItem <TViewModel>"
},
"api/DynamicVML.Extensions.ControllerExtensions.html": {
"href": "api/DynamicVML.Extensions.ControllerExtensions.html",
"title": "Class ControllerExtensions | DVML",
"keywords": "Class ControllerExtensions Extension methods to help sending back list items from the controllers. Inheritance Object ControllerExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Extensions Assembly : DynamicVML.dll Syntax public static class ControllerExtensions Remarks Please see the sample applications for examples on how they are used. Methods | Improve this Doc View Source PartialView(Controller, IDynamicList, AddNewDynamicItem) Creates the partial view for the item that should be sent back to the client. Declaration public static ActionResult PartialView(this Controller controller, IDynamicList item, AddNewDynamicItem parameters) Parameters Type Name Description Controller controller The controller handling the action for creating the new item. IDynamicList item The dynamic list item to be rendered. AddNewDynamicItem parameters The AddNewDynamicItem received by the controller. Returns Type Description ActionResult An ActionResult to be sent back to the client. | Improve this Doc View Source PartialView<TViewModel>(Controller, TViewModel, AddNewDynamicItem) Creates the partial view for the item that should be sent back to the client. Declaration public static ActionResult PartialView<TViewModel>(this Controller controller, TViewModel viewModel, AddNewDynamicItem parameters) where TViewModel : class Parameters Type Name Description Controller controller The controller handling the action for creating the new item. TViewModel viewModel The view model whose view should be rendered. AddNewDynamicItem parameters The AddNewDynamicItem received by the controller. Returns Type Description ActionResult An ActionResult to be sent back to the client. Type Parameters Name Description TViewModel The type of the view model whose view should be rendered. | Improve this Doc View Source PartialView<TViewModel>(Controller, TViewModel, AddNewDynamicItem, Action<DynamicListItem<TViewModel>>) Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post . Declaration public static ActionResult PartialView<TViewModel>(this Controller controller, TViewModel viewModel, AddNewDynamicItem parameters, Action<DynamicListItem<TViewModel>> options) where TViewModel : class Parameters Type Name Description Controller controller The controller handling the action for creating the new item. TViewModel viewModel The view model whose view should be rendered. AddNewDynamicItem parameters The AddNewDynamicItem received by the controller. Action < DynamicListItem <TViewModel>> options An action that allows for configuring the options to be associated with the new item before it gets inserted to the list. Returns Type Description ActionResult An ActionResult to be sent back to the client. Type Parameters Name Description TViewModel The type of the view model whose view should be rendered. | Improve this Doc View Source PartialView<TViewModel, TOptions>(Controller, TViewModel, AddNewDynamicItem, TOptions) Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post . Declaration public static ActionResult PartialView<TViewModel, TOptions>(this Controller controller, TViewModel viewModel, AddNewDynamicItem parameters, TOptions options) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description Controller controller The controller handling the action for creating the new item. TViewModel viewModel The view model whose view should be rendered. AddNewDynamicItem parameters The AddNewDynamicItem received by the controller. TOptions options Any additional options you might want to specify for this item. Returns Type Description ActionResult An ActionResult to be sent back to the client. Type Parameters Name Description TViewModel The type of the view model whose view should be rendered. TOptions The options associated with the view model. | Improve this Doc View Source PartialView<TViewModel, TOptions>(Controller, TViewModel, AddNewDynamicItem, Action<TOptions>) Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post . Declaration public static ActionResult PartialView<TViewModel, TOptions>(this Controller controller, TViewModel viewModel, AddNewDynamicItem parameters, Action<TOptions> options) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description Controller controller The controller handling the action for creating the new item. TViewModel viewModel The view model whose view should be rendered. AddNewDynamicItem parameters The AddNewDynamicItem received by the controller. Action <TOptions> options An action that allows for configuring the options to be associated with the new item before it gets inserted to the list. Returns Type Description ActionResult An ActionResult to be sent back to the client. Type Parameters Name Description TViewModel The type of the view model whose view should be rendered. TOptions The options associated with the view model. | Improve this Doc View Source PartialViewAsync(Controller, ICompositeViewEngine, IDynamicList, AddNewDynamicItem) Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post . Declaration public static Task<ActionResult> PartialViewAsync(this Controller controller, ICompositeViewEngine engine, IDynamicList item, AddNewDynamicItem parameters) Parameters Type Name Description Controller controller The controller handling the action for creating the new item. ICompositeViewEngine engine An instance of the ICompositeViewEngine class (which can be obtained using dependency injection by asking it as a new parameter in your controllers' constructor) IDynamicList item The dynamic list item to be rendered. AddNewDynamicItem parameters The AddNewDynamicItem received by the controller. Returns Type Description Task < ActionResult > An ActionResult to be sent back to the client. | Improve this Doc View Source PartialViewAsync<TViewModel>(Controller, ICompositeViewEngine, TViewModel, AddNewDynamicItem, Action<DynamicListItem<TViewModel>>) Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post . Declaration public static Task<ActionResult> PartialViewAsync<TViewModel>(this Controller controller, ICompositeViewEngine engine, TViewModel viewModel, AddNewDynamicItem parameters, Action<DynamicListItem<TViewModel>> options) where TViewModel : class Parameters Type Name Description Controller controller The controller handling the action for creating the new item. ICompositeViewEngine engine An instance of the ICompositeViewEngine class (which can be obtained using dependency injection by asking it as a new parameter in your controllers' constructor) TViewModel viewModel The view model whose view should be rendered. AddNewDynamicItem parameters The AddNewDynamicItem received by the controller. Action < DynamicListItem <TViewModel>> options Any additional options you might want to specify for this item. Returns Type Description Task < ActionResult > An ActionResult to be sent back to the client. Type Parameters Name Description TViewModel The type of the view model whose view should be rendered. | Improve this Doc View Source PartialViewAsync<TViewModel, TOptions>(Controller, ICompositeViewEngine, TViewModel, AddNewDynamicItem, TOptions) Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post . Declaration public static Task<ActionResult> PartialViewAsync<TViewModel, TOptions>(this Controller controller, ICompositeViewEngine engine, TViewModel viewModel, AddNewDynamicItem parameters, TOptions options) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description Controller controller The controller handling the action for creating the new item. ICompositeViewEngine engine An instance of the ICompositeViewEngine class (which can be obtained using dependency injection by asking it as a new parameter in your controllers' constructor) TViewModel viewModel The view model whose view should be rendered. AddNewDynamicItem parameters The AddNewDynamicItem received by the controller. TOptions options Any additional options you might want to specify for this item. Returns Type Description Task < ActionResult > An ActionResult to be sent back to the client. Type Parameters Name Description TViewModel The type of the view model whose view should be rendered. TOptions The options associated with the view model. | Improve this Doc View Source PartialViewAsync<TViewModel, TOptions>(Controller, ICompositeViewEngine, TViewModel, AddNewDynamicItem, Action<TOptions>) Renders a partial view containing the item to be in plain HTML, and converts it to JSON so it can be sent back to the client. You should only use this method when using Post . Declaration public static Task<ActionResult> PartialViewAsync<TViewModel, TOptions>(this Controller controller, ICompositeViewEngine engine, TViewModel viewModel, AddNewDynamicItem parameters, Action<TOptions> options) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description Controller controller The controller handling the action for creating the new item. ICompositeViewEngine engine An instance of the ICompositeViewEngine class (which can be obtained using dependency injection by asking it as a new parameter in your controllers' constructor) TViewModel viewModel The view model whose view should be rendered. AddNewDynamicItem parameters The AddNewDynamicItem received by the controller. Action <TOptions> options Any additional options you might want to specify for this item. Returns Type Description Task < ActionResult > An ActionResult to be sent back to the client. Type Parameters Name Description TViewModel The type of the view model whose view should be rendered. TOptions The options associated with the view model."
},
"api/DynamicVML.Extensions.EditorExtensions.html": {
"href": "api/DynamicVML.Extensions.EditorExtensions.html",
"title": "Class EditorExtensions | DVML",
"keywords": "Class EditorExtensions Contains extension methods for rendering different parts of the list from .cshtml view files. Inheritance Object EditorExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Extensions Assembly : DynamicVML.dll Syntax public static class EditorExtensions Remarks The methods in this class can be used to render different regions of a dynamic list from within a view. A quick reference for the regions can be seen in the figure below: Methods | Improve this Doc View Source DisplayListFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, Object, ListRenderMode) Renders a dynamic list for display. Please see the image in the remarks section for a quick understanding of all the different templates that can be specified. Declaration public static IHtmlContent DisplayListFor<TModel, TValue>(this IHtmlHelper<TModel> html, Expression<Func<TModel, TValue>> propertyExpression, string itemTemplate = null, string itemContainerTemplate = null, string listTemplate = null, string listContainerTemplate = \"DynamicListContainer\", object additionalViewData = null, ListRenderMode mode = ListRenderMode.ViewModelOnly) where TValue : IDynamicList Parameters Type Name Description IHtmlHelper <TModel> html The IHtmlHelper<TModel> from your current view. Expression < Func <TModel, TValue>> propertyExpression An expresion to be evaluated against the current model. String itemTemplate The view name for the view models to be displayed. String itemContainerTemplate The template for the \"DynamicItemContainer\" part of the list. String listTemplate The template for the \"DynamicList\" part of the list. String listContainerTemplate The template for the \"DynamicListContainer\" part of the list. Object additionalViewData An anonymous object or Dictionary<TKey,TValue> that can contain additional view data that will be merged into the ViewDataDictionary instance created for the template. ListRenderMode mode The ListRenderMode to be used when rendering the template for your view model. Please see the ListRenderMode for more details. Returns Type Description IHtmlContent The rendered HTML for the list. Type Parameters Name Description TModel The type of the model object in your current view. TValue The list to be displayed. Remarks | Improve this Doc View Source GetDynamicListActionUrl(IHtmlHelper<IDynamicList>) Gets a string with information about how request a new item from the server. Please see GetActionInfo() for more information. Declaration public static string GetDynamicListActionUrl(this IHtmlHelper<IDynamicList> html) Parameters Type Name Description IHtmlHelper < IDynamicList > html The IHtmlHelper<TModel> associated with the current view. Returns Type Description String A string containing information to be passed to the JavaScript scripts. | Improve this Doc View Source ListEditorFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, String, String, Object, ListRenderMode, NewItemMethod) Renders a dynamic list for display. Please see the image in the EditorExtensions remarks section to get a quick understanding of which part this refers to. Declaration public static IHtmlContent ListEditorFor<TModel, TValue>(this IHtmlHelper<TModel> html, Expression<Func<TModel, TValue>> propertyExpression, string actionUrl = null, string addNewItemText = null, string itemTemplate = null, string itemContainerTemplate = null, string listTemplate = null, string listContainerTemplate = \"DynamicListContainer\", object additionalViewData = null, ListRenderMode mode = ListRenderMode.ViewModelOnly, NewItemMethod method = NewItemMethod.Get) where TValue : IDynamicList Parameters Type Name Description IHtmlHelper <TModel> html The IHtmlHelper<TModel> from your current view. Expression < Func <TModel, TValue>> propertyExpression An expresion to be evaluated against the current model. String actionUrl The path to the controller action responsible for generating the view for a new item. String addNewItemText The text to be displayed in the button that the user can click to add a new item to the list. String itemTemplate The view name for the view models to be displayed. String itemContainerTemplate The template for the \"DynamicItemContainer\" part of the list. String listTemplate The template for the \"DynamicList\" part of the list. String listContainerTemplate The template for the \"DynamicListContainer\" part of the list. Object additionalViewData An anonymous object or Dictionary<TKey,TValue> that can contain additional view data that will be merged into the ViewDataDictionary instance created for the template. ListRenderMode mode The ListRenderMode to be used when rendering the template for your view model. Please see the ListRenderMode for more details. NewItemMethod method The NewItemMethod to use, whether Get or Post . Returns Type Description IHtmlContent The rendered HTML for the list. Type Parameters Name Description TModel The type of the model object in your current view. TValue The list to be displayed. Remarks Warning The additionalViewData object will not be sent back to the server when the user clicks the \"Add new item\" button if method is also set to Get . However, it will still be passed to the templates during the first rendering of the list. In order to be able to receive the additional data from the controller, please also specify method : NewItemMethod.Post . | Improve this Doc View Source RenderDynamicItemContainerDisplay<TModel>(IHtmlHelper<TModel>, String) Renders the \"DynamicItemContainer\" part of the list to the view. Please see the image in the EditorExtensions remarks section to get a quick understanding of which part this refers to. Declaration public static IHtmlContent RenderDynamicItemContainerDisplay<TModel>(this IHtmlHelper<TModel> html, string itemId) where TModel : IDynamicList Parameters Type Name Description IHtmlHelper <TModel> html The IHtmlHelper<TModel> from your current view. String itemId The div id (key of the item in the DynamicList<TViewModel, TOptions> ) for the current item being rendered. Returns Type Description IHtmlContent An awaitable async task. Type Parameters Name Description TModel The type of the model object in your current view. | Improve this Doc View Source RenderDynamicItemContainerEditor<TModel>(IHtmlHelper<TModel>, String) Renders the \"DynamicItemContainer\" part of the list to the view. Please see the image in EditorExtensions remarks section to get a quick understanding of which part this refers to. Declaration public static IHtmlContent RenderDynamicItemContainerEditor<TModel>(this IHtmlHelper<TModel> html, string itemId) where TModel : IDynamicList Parameters Type Name Description IHtmlHelper <TModel> html The IHtmlHelper<TModel> from your current view. String itemId The div id (key of the item in the DynamicList<TViewModel, TOptions> ) for the current item being rendered. Returns Type Description IHtmlContent An awaitable async task. Type Parameters Name Description TModel The type of the model object in your current view. | Improve this Doc View Source RenderDynamicItemDisplay<TModel>(IHtmlHelper<TModel>) Renders the \"Item\" part of the list to the view. This corresponds to your actual user-provided view for your current viewmodel. Please see the image in EditorExtensions remarks section to get a quick understanding of which part this refers to. Declaration public static IHtmlContent RenderDynamicItemDisplay<TModel>(this IHtmlHelper<TModel> html) where TModel : IDynamicListItem Parameters Type Name Description IHtmlHelper <TModel> html The IHtmlHelper<TModel> from your current view. Returns Type Description IHtmlContent An awaitable async task. Type Parameters Name Description TModel The type of the model object in your current view. | Improve this Doc View Source RenderDynamicItemEditor<TModel>(IHtmlHelper<TModel>) Renders the \"Item\" part of the list to the view. This corresponds to your actual user-provided view for your current viewmodel. Please see the image in EditorExtensions remarks section to get a quick understanding of which part this refers to. Declaration public static IHtmlContent RenderDynamicItemEditor<TModel>(this IHtmlHelper<TModel> html) where TModel : IDynamicListItem Parameters Type Name Description IHtmlHelper <TModel> html The IHtmlHelper<TModel> from your current view. Returns Type Description IHtmlContent An awaitable async task. Type Parameters Name Description TModel The type of the model object in your current view. | Improve this Doc View Source RenderDynamicListAddNewItemText(IHtmlHelper<IDynamicList>) Renders the \"Add new item\" text that have been defined in the AddNewItemText to the view. Declaration public static string RenderDynamicListAddNewItemText(this IHtmlHelper<IDynamicList> html) Parameters Type Name Description IHtmlHelper < IDynamicList > html The IHtmlHelper<TModel> associated with the current view. Returns Type Description String A string containing the specified text, e.g., \"Add new book\". | Improve this Doc View Source RenderDynamicListDisplay<TModel>(IHtmlHelper<TModel>) Renders the \"DynamicList\" part of the list to the view. Please see the image in EditorExtensions remarks section to get a quick understanding of which part this refers to. Declaration public static void RenderDynamicListDisplay<TModel>(this IHtmlHelper<TModel> html) where TModel : IDynamicList Parameters Type Name Description IHtmlHelper <TModel> html The IHtmlHelper<TModel> from your current view. Type Parameters Name Description TModel The type of the model object in your current view. | Improve this Doc View Source RenderDynamicListEditor<TModel>(IHtmlHelper<TModel>) Renders the \"DynamicList\" part of the list to the view. Please see the image in EditorExtensions remarks section to get a quick understanding of which part this refers to. Declaration public static void RenderDynamicListEditor<TModel>(this IHtmlHelper<TModel> html) where TModel : IDynamicList Parameters Type Name Description IHtmlHelper <TModel> html The IHtmlHelper<TModel> from your current view. Type Parameters Name Description TModel The type of the model object in your current view."
},
"api/DynamicVML.Extensions.EnumerableExtensions.html": {
"href": "api/DynamicVML.Extensions.EnumerableExtensions.html",
"title": "Class EnumerableExtensions | DVML",
"keywords": "Class EnumerableExtensions Contains extension methods to convert view models and option objects to DynamicList<TViewModel, TOptions> . Inheritance Object EnumerableExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Extensions Assembly : DynamicVML.dll Syntax public static class EnumerableExtensions Methods | Improve this Doc View Source ToDynamicList<TViewModel>(TViewModel, String) Wraps a single view model into a partial dynamic list that can be sent back to the client. Declaration public static DynamicList<TViewModel> ToDynamicList<TViewModel>(this TViewModel viewModel, string containerId) where TViewModel : class Parameters Type Name Description TViewModel viewModel The view model to be wrapped in a partial dynamic list. String containerId The div ID of the already existing dynamic list container. Returns Type Description DynamicList <TViewModel> A partial dynamic list with a single item that can be passed to the client. Type Parameters Name Description TViewModel The type of your view model. | Improve this Doc View Source ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) Wraps a single view model into a partial dynamic list that can be sent back to the client. Declaration public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions>(this TViewModel viewModel, string containerId, TOptions options) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description TViewModel viewModel The view model to be wrapped in a partial dynamic list. String containerId The div ID of the already existing dynamic list container. TOptions options The options to be associated with your view model. Note that this method will set the ViewModel property of the given options object to the given viewModel . Returns Type Description DynamicList <TViewModel, TOptions> A partial dynamic list with a single item that can be passed to the client. Type Parameters Name Description TViewModel The type of your view model. TOptions The type of the options to be associated with your view model. | Improve this Doc View Source ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) Wraps a single view model into a partial dynamic list that can be sent back to the client. Declaration public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions>(this TViewModel viewModel, string containerId, Func<TViewModel, TOptions> optionsSelector) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description TViewModel viewModel The view model to be wrapped in a partial dynamic list. String containerId The div ID of the already existing dynamic list container. Func <TViewModel, TOptions> optionsSelector A function that can be used to define how your view model should be wrapped in a TOptions object. Returns Type Description DynamicList <TViewModel, TOptions> A partial dynamic list with a single item that can be passed to the client. Type Parameters Name Description TViewModel The type of your view model. TOptions The type of the options to be associated with your view model. | Improve this Doc View Source ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) Wraps a single view model into a partial dynamic list that can be sent back to the client. Declaration public static DynamicList<TViewModel> ToDynamicList<TViewModel, TModel>(this TModel model, string containerId, Func<TModel, TViewModel> viewModelSelector) where TViewModel : class Parameters Type Name Description TModel model The database model to be converted in a view model and wrapped in a partial dynamic list. String containerId The div ID of the already existing dynamic list container. Func <TModel, TViewModel> viewModelSelector A function that can be used to define how your view model should be created from your model. Returns Type Description DynamicList <TViewModel> A partial dynamic list with a single item that can be passed to the client. Type Parameters Name Description TViewModel The type of your view model. TModel The type of your (database) model. | Improve this Doc View Source ToDynamicList<TViewModel, TOptions>(IEnumerable<TViewModel>) Converts a list of TViewModel objects into a DynamicList<TViewModel, TOptions> . Declaration public static DynamicList<TViewModel> ToDynamicList<TViewModel, TOptions>(this IEnumerable<TViewModel> viewModels) where TViewModel : class Parameters Type Name Description IEnumerable <TViewModel> viewModels The list of viewmodel objects to be wrapped in option objects and then added to the list. Returns Type Description DynamicList <TViewModel> A DynamicList<TViewModel, TOptions> containing the given viewModels . Type Parameters Name Description TViewModel The type of your view model. TOptions The type of the options to be associated with your view model. | Improve this Doc View Source ToDynamicList<TViewModel, TOptions>(IEnumerable<TViewModel>, Func<TViewModel, TOptions>) Converts a list of TViewModel objects into a DynamicList<TViewModel, TOptions> . Declaration public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions>(this IEnumerable<TViewModel> viewModels, Func<TViewModel, TOptions> optionsSelector) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description IEnumerable <TViewModel> viewModels The list of viewmodel objects to be wrapped in option objects and then added to the list. Func <TViewModel, TOptions> optionsSelector A function that can be used to configure the TOptions associated with each of your viewModels . Returns Type Description DynamicList <TViewModel, TOptions> A DynamicList<TViewModel, TOptions> containing the given viewModels . Type Parameters Name Description TViewModel The type of your view model. TOptions The type of the options to be associated with your view model. | Improve this Doc View Source ToDynamicList<TViewModel, TOptions>(IEnumerable<TOptions>) Converts a list of TOptions objects into a DynamicList<TViewModel, TOptions> . Declaration public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions>(this IEnumerable<TOptions> options) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description IEnumerable <TOptions> options The list of options objects to be added to the list. Returns Type Description DynamicList <TViewModel, TOptions> A DynamicList<TViewModel, TOptions> containing the given options . Type Parameters Name Description TViewModel The type of your view model. TOptions The type of the options to be associated with your view model. | Improve this Doc View Source ToDynamicList<TViewModel, TModel>(IEnumerable<TModel>, Func<TModel, TViewModel>) Converts a list of TViewModel objects into a DynamicList<TViewModel, TOptions> . Declaration public static DynamicList<TViewModel> ToDynamicList<TViewModel, TModel>(this IEnumerable<TModel> models, Func<TModel, TViewModel> viewModelSelector) where TViewModel : class Parameters Type Name Description IEnumerable <TModel> models A list of database models to be converted into view models, and then inserted in a dynamic list. Func <TModel, TViewModel> viewModelSelector A function that can be used to define how your view model should be created from your model. Returns Type Description DynamicList <TViewModel> Type Parameters Name Description TViewModel The type of your view models. TModel The type of your (database) models. | Improve this Doc View Source ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) Wraps a single view model into a partial dynamic list that can be sent back to the client. Declaration public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions, TModel>(this TModel model, string containerId, Func<TModel, TViewModel> viewModelSelector, Func<TModel, TOptions> optionsSelector) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description TModel model The database model to be converted in a view model and wrapped in a partial dynamic list. String containerId The div ID of the already existing dynamic list container. Func <TModel, TViewModel> viewModelSelector A function that can be used to define how your view model should be created from your model. Func <TModel, TOptions> optionsSelector A function that can be used to define how your view model should be wrapped in a TOptions object. Returns Type Description DynamicList <TViewModel, TOptions> A partial dynamic list with a single item that can be passed to the client. Type Parameters Name Description TViewModel The type of your view model. TOptions The type of the options to be associated with your view model. TModel The type of your (database) model. | Improve this Doc View Source ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) Wraps a single view model into a partial dynamic list that can be sent back to the client. Declaration public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions, TModel>(this TModel model, string containerId, Func<TModel, TOptions> optionsSelector) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description TModel model The database model to be converted in a view model and wrapped in a partial dynamic list. String containerId The div ID of the already existing dynamic list container. Func <TModel, TOptions> optionsSelector A function that can be used to define how your view model should be wrapped in a TOptions object. Returns Type Description DynamicList <TViewModel, TOptions> A partial dynamic list with a single item that can be passed to the client. Type Parameters Name Description TViewModel The type of your view model. TOptions The type of the options to be associated with your view model. TModel The type of your (database) model. | Improve this Doc View Source ToDynamicList<TViewModel, TOptions, TModel>(IEnumerable<TModel>, Func<TModel, TViewModel>, Func<TModel, TOptions>) Converts a list of TViewModel objects into a DynamicList<TViewModel, TOptions> . Declaration public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions, TModel>(this IEnumerable<TModel> models, Func<TModel, TViewModel> viewModelSelector, Func<TModel, TOptions> optionsSelector) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description IEnumerable <TModel> models A list of database models to be converted into view models, wrapped in TOptions objects, and then inserted in a dynamic list. Func <TModel, TViewModel> viewModelSelector A function that can be used to define how your view model should be created from your model. Func <TModel, TOptions> optionsSelector A function that can be used to define how your view model should be wrapped in a TOptions object. Returns Type Description DynamicList <TViewModel, TOptions> Type Parameters Name Description TViewModel The type of your view models. TOptions The type of the options to be associated with your view models. TModel The type of your (database) models. | Improve this Doc View Source ToDynamicList<TViewModel, TOptions, TModel>(IEnumerable<TModel>, Func<TModel, TOptions>) Converts a list of TViewModel objects into a DynamicList<TViewModel, TOptions> . Declaration public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions, TModel>(this IEnumerable<TModel> models, Func<TModel, TOptions> optionsSelector) where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new() Parameters Type Name Description IEnumerable <TModel> models A list of database models to be converted into view models, wrapped in TOptions objects, and then inserted in a dynamic list. Func <TModel, TOptions> optionsSelector A function that can be used to define how your view model should be wrapped in a TOptions object. Returns Type Description DynamicList <TViewModel, TOptions> Type Parameters Name Description TViewModel The type of your view models. TOptions The type of the options to be associated with your view models. TModel The type of your (database) models."
},
"api/DynamicVML.Extensions.html": {
"href": "api/DynamicVML.Extensions.html",
"title": "Namespace DynamicVML.Extensions | DVML",
"keywords": "Namespace DynamicVML.Extensions Classes ControllerExtensions Extension methods to help sending back list items from the controllers. EditorExtensions Contains extension methods for rendering different parts of the list from .cshtml view files. EnumerableExtensions Contains extension methods to convert view models and option objects to DynamicList<TViewModel, TOptions> . ViewDataExtensions Contains extension methods for extracting and storing information related to DynamicList<TViewModel, TOptions> from ViewDataDictionary objects."
},
"api/DynamicVML.Extensions.ViewDataExtensions.html": {
"href": "api/DynamicVML.Extensions.ViewDataExtensions.html",
"title": "Class ViewDataExtensions | DVML",
"keywords": "Class ViewDataExtensions Contains extension methods for extracting and storing information related to DynamicList<TViewModel, TOptions> from ViewDataDictionary objects. Inheritance Object ViewDataExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Extensions Assembly : DynamicVML.dll Syntax public static class ViewDataExtensions Methods | Improve this Doc View Source GetDynamicListAttribute(ViewDataDictionary) Attempts to extract a DynamicListAttribute from the model's metadata stored in the Model property. Declaration public static DynamicListAttribute GetDynamicListAttribute(this ViewDataDictionary viewData) Parameters Type Name Description ViewDataDictionary viewData The view data containing the metadata to be inspected. Returns Type Description DynamicListAttribute A DynamicListAttribute object if one is set; otherwise null. | Improve this Doc View Source GetItemCreateParameters(ViewDataDictionary, String) Extracts a AddNewDynamicItem object from a ViewDataDictionary dictionary. Declaration public static AddNewDynamicItem GetItemCreateParameters(this ViewDataDictionary viewData, string itemId) Parameters Type Name Description ViewDataDictionary viewData The view data dictionary that should contain the object. If the object is not present, an ApplicationException will be thrown. String itemId The HTML div ID for the current list item. Returns Type Description AddNewDynamicItem The AddNewDynamicItem stored in the view data. | Improve this Doc View Source GetItemDisplayParameters(ViewDataDictionary, String, String) Retrieves the ItemDisplayParameters object stored in the ViewDataDictionary . If no ItemDisplayParameters is available, a new one will be created from the information stored in the ListDisplayParameters object that should have been stored in the ViewData. Declaration public static ItemDisplayParameters GetItemDisplayParameters(this ViewDataDictionary viewData, string itemId, string containerId = null) Parameters Type Name Description ViewDataDictionary viewData The view data object from where information will be extracted. String itemId The HTML div element ID for the current list item. String containerId The HTML div element ID for the current list. Returns Type Description ItemDisplayParameters | Improve this Doc View Source GetItemEditorParameters(ViewDataDictionary, String, AddNewDynamicItem, NewItemMethod) Re-creates a ItemEditorParameters from the partial information about the original list contained in a AddNewDynamicItem object. This information will be stored in the ViewDataDictionary in order to make the rest of the code work the same as much as possible. Declaration public static ItemEditorParameters GetItemEditorParameters(this ViewDataDictionary viewData, string itemId, AddNewDynamicItem newItemParameters, NewItemMethod method) Parameters Type Name Description ViewDataDictionary viewData The view data object from where information will be extracted. String itemId The HTML div element ID for the current list item. AddNewDynamicItem newItemParameters The AddNewDynamicItem parameters containing information about how the controller should create new items to be added to the list. NewItemMethod method The HTTP method used when calling the controller to add new items to the list. Returns Type Description ItemEditorParameters | Improve this Doc View Source GetItemEditorParameters(ViewDataDictionary, String, String) Retrieves the ItemEditorParameters object stored in the ViewDataDictionary . If no ItemEditorParameters is available, a new one will be created from the information stored in the ListEditorParameters object that should have been stored in the ViewData. Declaration public static ItemEditorParameters GetItemEditorParameters(this ViewDataDictionary viewData, string itemId, string containerId = null) Parameters Type Name Description ViewDataDictionary viewData The view data object from where information will be extracted. String itemId The HTML div element ID for the current list item. String containerId The HTML div element ID for the current list. Returns Type Description ItemEditorParameters | Improve this Doc View Source GetListDisplayParameters(ViewDataDictionary, String) Builds a new ListDisplayParameters object gathering information from different sources, including DynamicListDisplayOptions objects that may be stored in the view data, DynamicListAttribute attributes defined in the view model class, or, as a last resort, reflection. Declaration public static ListDisplayParameters GetListDisplayParameters(this ViewDataDictionary viewData, string containerId) Parameters Type Name Description ViewDataDictionary viewData The view data object from where information will be extracted. String containerId The HTML div element ID for the current list. Returns Type Description ListDisplayParameters A new ListDisplayParameters object with the actual values to be used when rendering the editor view for your view model. Remarks Warning This method will resort to reflecion in case the ItemTemplate , ActionUrl , or AddNewItemText have not been specified, which can incur a significant performance impact on the server. To avoid the extra performance hit, specify the name of the view you want to use for your view model when calling DisplayListFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, Object, ListRenderMode) | Improve this Doc View Source GetListEditorParameters(ViewDataDictionary, String) Builds a new ListEditorParameters object gathering information from different sources, including DynamicListEditorOptions objects that may be stored in the view data, DynamicListAttribute attributes defined in the view model class, or, as a last resort, reflection. Declaration public static ListEditorParameters GetListEditorParameters(this ViewDataDictionary viewData, string containerId) Parameters Type Name Description ViewDataDictionary viewData The view data object from where information will be extracted. String containerId The HTML div element ID for the current list. Returns Type Description ListEditorParameters A new ListEditorParameters object with the actual values to be used when rendering the editor view for your view model. Remarks Warning This method will resort to reflecion in case the ItemTemplate has not been specified, which can incur a significant performance impact on the server. To avoid the extra performance hit, specify the name of the view you want to use for your view model when calling ListEditorFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, String, String, Object, ListRenderMode, NewItemMethod)"
},
"api/DynamicVML.html": {
"href": "api/DynamicVML.html",
"title": "Namespace DynamicVML | DVML",
"keywords": "Namespace DynamicVML Classes AddNewDynamicItem Represents the data object that the client can send to the server to request a new partial view for a new list item using ajax. When the controller creates this new partial view, an instance of this class will be stored in the ViewDataDictionary object of the views under the key ItemCreateParameters . DynamicList<TViewModel> Represents a list of view model objects that can be added and removed from a form through Ajax. This class can be used to create lists of view models that contain no custom options. To specify custom options for your objects, see DynamicList<TViewModel, TOptions> . DynamicList<TViewModel, TOptions> Represents a list of view model objects that can be added and removed from a form through Ajax. This class can be used to create lists of view models that contain custom options for your items. DynamicListItem<TViewModel> Represents a list item containing a TViewModel for the item and its associated options. Interfaces IDynamicList Represents a list whose items are tracked by a string key associated with the id of div elements in an HTML form, and whose items can be succesfully binded to object properties by ASP.NET's default IModelBinder . IDynamicList<TValue> Represents a list whose items are tracked by a string key associated with the id of div elements in an HTML form, and whose items can be succesfully binded to object properties by ASP.NET's default IModelBinder . IDynamicListItem Represents an item stored in a DynamicList<TViewModel, TOptions> when the type of the view model does not need to be known. This is normally the case when handling the list from inside a list template view. IDynamicListItem<TViewModel> Represents an item stored in a DynamicList<TViewModel, TOptions> when the type of the view model needs to be known. Enums ListRenderMode Represents different rendering modes for the final (user-provided) item template. NewItemMethod Represents different HTTP methods which can be used to retrieve new list items from the server. Default is to use Get ."
},
"api/DynamicVML.IDynamicList.html": {
"href": "api/DynamicVML.IDynamicList.html",
"title": "Interface IDynamicList | DVML",
"keywords": "Interface IDynamicList Represents a list whose items are tracked by a string key associated with the id of div elements in an HTML form, and whose items can be succesfully binded to object properties by ASP.NET's default IModelBinder . Namespace : DynamicVML Assembly : DynamicVML.dll Syntax public interface IDynamicList Remarks This is the non-generic version of IDynamicList<TValue> which can be used whenever list item types do not need to be known. This will usually be the case when acessing the dynamic list from a template view. Properties | Improve this Doc View Source ContainerId The HTML div ID associated with this list. This ID is generated automatically using the CreateId() method and is guaranteed to be unique. Declaration string ContainerId { get; set; } Property Value Type Description String The identifier for the HTML div element that contains the representation of this list in an HTML form. | Improve this Doc View Source Count Gets the number of elements contained in this list. Declaration int Count { get; } Property Value Type Description Int32 The number of elements in this list. | Improve this Doc View Source Index This property is required to help IModelBinder during runtime and does not have to be set to anything when creating the list. Declaration string Index { get; set; } Property Value Type Description String | Improve this Doc View Source Item[String] Gets the with the specified identifier as an IDynamicListItem object. Declaration IDynamicListItem this[string id] { get; } Parameters Type Name Description String id Property Value Type Description IDynamicListItem Remarks This is an explicit interface implementation which is only available when interacting with this list through the IDynamicList interface. Normally, this should only be the case when accessing the list from a view. | Improve this Doc View Source Keys Gets an enumerable that can be used to iterate through the identifiers of the div HTML elements used by your view models when rendered in a form. Declaration IEnumerable<string> Keys { get; } Property Value Type Description IEnumerable < String > The keys, represented as an IEnumerable<T> . Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) See Also IDynamicListItem <TViewModel>"
},
"api/DynamicVML.IDynamicList-1.html": {
"href": "api/DynamicVML.IDynamicList-1.html",
"title": "Interface IDynamicList<TValue> | DVML",
"keywords": "Interface IDynamicList<TValue> Represents a list whose items are tracked by a string key associated with the id of div elements in an HTML form, and whose items can be succesfully binded to object properties by ASP.NET's default IModelBinder . Inherited Members IDynamicList.Count IDynamicList.ContainerId IDynamicList.Index IDynamicList.Keys Namespace : DynamicVML Assembly : DynamicVML.dll Syntax public interface IDynamicList<out TValue> : IDynamicList where TValue : IDynamicListItem Type Parameters Name Description TValue Remarks This is the generic version of IDynamicList which can be used whenever list item types need to be known. Properties | Improve this Doc View Source Item[String] Gets the with the specified identifier. Declaration TValue this[string id] { get; } Parameters Type Name Description String id Property Value Type Description TValue Remarks This is an explicit interface implementation which is only available when interacting with this list through the IDynamicList<TValue> interface. Normally, this should only be the case when accessing the list from a view. Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) See Also IDynamicListItem"
},
"api/DynamicVML.IDynamicListItem.html": {
"href": "api/DynamicVML.IDynamicListItem.html",
"title": "Interface IDynamicListItem | DVML",
"keywords": "Interface IDynamicListItem Represents an item stored in a DynamicList<TViewModel, TOptions> when the type of the view model does not need to be known. This is normally the case when handling the list from inside a list template view. Namespace : DynamicVML Assembly : DynamicVML.dll Syntax public interface IDynamicListItem Properties | Improve this Doc View Source Index This property is needed by the IModelBinder in order to bind this item correctly to the HTML form. It does not have to be set manually and will likely be overwritten by the rest of the library. Declaration string Index { get; set; } Property Value Type Description String The index of the item, represented as a GUID value formatted as a HTML-friendly string. | Improve this Doc View Source ViewModel Gets the view model associated with this item as an object. Declaration object ViewModel { get; } Property Value Type Description Object The view model. Remarks This property is only visible when handling this item through the non-generic IDynamicListItem interface, which normally should be the case only when acessing this item from a view (e.g. list templates). Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>)"
},
"api/DynamicVML.IDynamicListItem-1.html": {
"href": "api/DynamicVML.IDynamicListItem-1.html",
"title": "Interface IDynamicListItem<TViewModel> | DVML",
"keywords": "Interface IDynamicListItem<TViewModel> Represents an item stored in a DynamicList<TViewModel, TOptions> when the type of the view model needs to be known. Inherited Members IDynamicListItem.Index Namespace : DynamicVML Assembly : DynamicVML.dll Syntax public interface IDynamicListItem<out TViewModel> : IDynamicListItem where TViewModel : class Type Parameters Name Description TViewModel Properties | Improve this Doc View Source ViewModel Gets or sets the view model stored in this item. Declaration TViewModel ViewModel { get; } Property Value Type Description TViewModel The view model. Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>)"
},
"api/DynamicVML.Internals.Constants.html": {
"href": "api/DynamicVML.Internals.Constants.html",
"title": "Class Constants | DVML",
"keywords": "Class Constants Constants that are used throughout the Dynamic View Model library. You can use the value of those constants to access internal objects created by the library which may be present in your view's ViewDataDictionary . Inheritance Object Constants Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Internals Assembly : DynamicVML.dll Syntax public static class Constants Fields | Improve this Doc View Source AdditionalViewData Gets the string value that is used as a key in ViewData dictionaries when storing additional user data objects. Declaration public const string AdditionalViewData = \"DynamicList_AdditionalViewData\" Field Value Type Description String | Improve this Doc View Source CurrentContainerId Gets the string value that is used as a key in ViewData dictionaries when storing the ContainerId for the current list. Declaration public const string CurrentContainerId = \"DynamicList_CurrentContainerId\" Field Value Type Description String | Improve this Doc View Source CurrentIndex Gets the string value that is used as a key in ViewData dictionaries when storing the Index for the current item. Declaration public const string CurrentIndex = \"DynamicList_CurrentIndex\" Field Value Type Description String | Improve this Doc View Source DefaultItemContainerTemplate Gets the default file name for list item containers. The default is \"DynamicItemContainer\". Declaration public const string DefaultItemContainerTemplate = \"DynamicItemContainer\" Field Value Type Description String | Improve this Doc View Source DefaultListContainerTemplate Gets the default file name for list containers. The default is \"DynamicListContainer\". Declaration public const string DefaultListContainerTemplate = \"DynamicListContainer\" Field Value Type Description String | Improve this Doc View Source DefaultListTemplate Gets the default file name for lists. The default is \"DynamicList\". Declaration public const string DefaultListTemplate = \"DynamicList\" Field Value Type Description String | Improve this Doc View Source DisplayOptions Gets the string value that is used as a key in ViewData dictionaries when storing DisplayOptions objects for the current view. Declaration public const string DisplayOptions = \"DynamicList_DisplayOptions\" Field Value Type Description String | Improve this Doc View Source EditorOptions Gets the string value that is used as a key in ViewData dictionaries when storing EditorOptions objects for the current view. Declaration public const string EditorOptions = \"DynamicList_EditorOptions\" Field Value Type Description String | Improve this Doc View Source ItemCreateParameters Gets the string value that is used as a key in ViewData dictionaries when storing AddNewDynamicItem objects for the current view. Declaration public const string ItemCreateParameters = \"DynamicList_ItemCreateParameters\" Field Value Type Description String | Improve this Doc View Source ItemDisplayParameters Gets the string value that is used as a key in ViewData dictionaries when storing ItemDisplayParameters objects for the current view. Declaration public const string ItemDisplayParameters = \"DynamicList_ItemDisplayParameters\" Field Value Type Description String | Improve this Doc View Source ItemEditorParameters Gets the string value that is used as a key in ViewData dictionaries when storing ItemEditorParameters objects for the current view. Declaration public const string ItemEditorParameters = \"DynamicList_ItemEditorParameters\" Field Value Type Description String | Improve this Doc View Source ListDisplayParameters Gets the string value that is used as a key in ViewData dictionaries when storing ListDisplayParameters objects for the current view. Declaration public const string ListDisplayParameters = \"DynamicList_ListDisplayParameters\" Field Value Type Description String | Improve this Doc View Source ListEditorParameters Gets the string value that is used as a key in ViewData dictionaries when storing ListEditorParameters objects for the current view. Declaration public const string ListEditorParameters = \"DynamicList_ListEditorParameters\" Field Value Type Description String"
},
"api/DynamicVML.Internals.html": {
"href": "api/DynamicVML.Internals.html",
"title": "Namespace DynamicVML.Internals | DVML",
"keywords": "Namespace DynamicVML.Internals Classes Constants Constants that are used throughout the Dynamic View Model library. You can use the value of those constants to access internal objects created by the library which may be present in your view's ViewDataDictionary . ItemDisplayParameters Represents the actual parameters being used to render an item of the list for display. An instance of this class will be stored in the ViewData object of your view under the key ItemDisplayParameters . ItemEditorParameters Represents the actual parameters being used to render an item of the list for edit. An instance of this class will be stored in the ViewData object of your view under the key ItemEditorParameters . ItemParameters Base class for ItemDisplayParameters and ItemEditorParameters . ListDisplayParameters Represents the actual parameters being used to render the list. An instance of this class will be stored in the ViewData object of your view under the key ListDisplayParameters . You should never need to instantiate this class directly as it is part of the inner workings of the library. ListEditorParameters Represents the actual parameters being used to render an editor for the list. An instance of this class will be stored in the ViewData object of your view under the key ListEditorParameters . ListParameters Represents a collection of read-only parameter values that are being used to currently render the list. Those cannot be changed after rendering has started. Parameters Base class for ListParameters and ItemParameters ."
},
"api/DynamicVML.Internals.ItemDisplayParameters.html": {
"href": "api/DynamicVML.Internals.ItemDisplayParameters.html",
"title": "Class ItemDisplayParameters | DVML",
"keywords": "Class ItemDisplayParameters Represents the actual parameters being used to render an item of the list for display. An instance of this class will be stored in the ViewData object of your view under the key ItemDisplayParameters . Inheritance Object Parameters ItemParameters ItemDisplayParameters Inherited Members ItemParameters.Index Parameters.ContainerId Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Internals Assembly : DynamicVML.dll Syntax public class ItemDisplayParameters : ItemParameters Constructors | Improve this Doc View Source ItemDisplayParameters(String, String, ListDisplayParameters) Creates a new instance of ItemDisplayParameters . Declaration public ItemDisplayParameters(string containerId, string itemId, ListDisplayParameters parameters) Parameters Type Name Description String containerId String itemId ListDisplayParameters parameters Properties | Improve this Doc View Source Display Gets the parameters used to render this list for display. Declaration public ListDisplayParameters Display { get; } Property Value Type Description ListDisplayParameters Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) See Also ListDisplayParameters ItemEditorParameters"
},
"api/DynamicVML.Internals.ItemEditorParameters.html": {
"href": "api/DynamicVML.Internals.ItemEditorParameters.html",
"title": "Class ItemEditorParameters | DVML",
"keywords": "Class ItemEditorParameters Represents the actual parameters being used to render an item of the list for edit. An instance of this class will be stored in the ViewData object of your view under the key ItemEditorParameters . Inheritance Object Parameters ItemParameters ItemEditorParameters Inherited Members ItemParameters.Index Parameters.ContainerId Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Internals Assembly : DynamicVML.dll Syntax public class ItemEditorParameters : ItemParameters Constructors | Improve this Doc View Source ItemEditorParameters(String, String, AddNewDynamicItem, ListEditorParameters) Creates a new instance of ItemEditorParameters . Declaration public ItemEditorParameters(string containerId, string itemId, AddNewDynamicItem newItemParameters, ListEditorParameters editorParameters) Parameters Type Name Description String containerId String itemId AddNewDynamicItem newItemParameters ListEditorParameters editorParameters Properties | Improve this Doc View Source AddNewItem Gets the parameters that should be sent to the server with instructions on how to create new items to be dynamically added to the list. Declaration public AddNewDynamicItem AddNewItem { get; } Property Value Type Description AddNewDynamicItem | Improve this Doc View Source Editor Gets the parameters used to render this list for edit. Declaration public ListEditorParameters Editor { get; } Property Value Type Description ListEditorParameters Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) See Also ListEditorParameters ItemDisplayParameters"
},
"api/DynamicVML.Internals.ItemParameters.html": {
"href": "api/DynamicVML.Internals.ItemParameters.html",
"title": "Class ItemParameters | DVML",
"keywords": "Class ItemParameters Base class for ItemDisplayParameters and ItemEditorParameters . Inheritance Object Parameters ItemParameters ItemDisplayParameters ItemEditorParameters Inherited Members Parameters.ContainerId Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Internals Assembly : DynamicVML.dll Syntax public abstract class ItemParameters : Parameters Constructors | Improve this Doc View Source ItemParameters(String, String) Creates a new instance of the Parameters class. Declaration public ItemParameters(string containerId, string itemId) Parameters Type Name Description String containerId The HTML div element ID for the current list. String itemId The HTML div element ID for the current list item. Properties | Improve this Doc View Source Index Gets the HTML div ID associted with this list item. Declaration public string Index { get; } Property Value Type Description String Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>)"
},
"api/DynamicVML.Internals.ListDisplayParameters.html": {
"href": "api/DynamicVML.Internals.ListDisplayParameters.html",
"title": "Class ListDisplayParameters | DVML",
"keywords": "Class ListDisplayParameters Represents the actual parameters being used to render the list. An instance of this class will be stored in the ViewData object of your view under the key ListDisplayParameters . You should never need to instantiate this class directly as it is part of the inner workings of the library. Inheritance Object ListDisplayParameters ListEditorParameters Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Internals Assembly : DynamicVML.dll Syntax public class ListDisplayParameters Constructors | Improve this Doc View Source ListDisplayParameters(ListParameters, Object) Creates a new instance of ListEditorParameters . Declaration public ListDisplayParameters(ListParameters parameters, object additionalViewData) Parameters Type Name Description ListParameters parameters Object additionalViewData Properties | Improve this Doc View Source AdditionalViewData Gets any additional view data which may have been passed by the user when calling the DisplayListFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, Object, ListRenderMode) or ListEditorFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, String, String, Object, ListRenderMode, NewItemMethod) extension methods. Declaration public object AdditionalViewData { get; } Property Value Type Description Object | Improve this Doc View Source List Gets the parameters used to create this list. Declaration public ListParameters List { get; } Property Value Type Description ListParameters Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>)"
},
"api/DynamicVML.Internals.ListEditorParameters.html": {
"href": "api/DynamicVML.Internals.ListEditorParameters.html",
"title": "Class ListEditorParameters | DVML",
"keywords": "Class ListEditorParameters Represents the actual parameters being used to render an editor for the list. An instance of this class will be stored in the ViewData object of your view under the key ListEditorParameters . Inheritance Object ListDisplayParameters ListEditorParameters Inherited Members ListDisplayParameters.List ListDisplayParameters.AdditionalViewData Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Internals Assembly : DynamicVML.dll Syntax public class ListEditorParameters : ListDisplayParameters Constructors | Improve this Doc View Source ListEditorParameters(ListParameters, Object, String, String, NewItemMethod) Creates a new instance of ListEditorParameters . Declaration public ListEditorParameters(ListParameters parameters, object additionalViewData, string actionUrl, string addNewItemText, NewItemMethod method) Parameters Type Name Description ListParameters parameters Object additionalViewData String actionUrl String addNewItemText NewItemMethod method Properties | Improve this Doc View Source ActionUrl Gets the actual ActionUrl being used. Declaration public string ActionUrl { get; } Property Value Type Description String | Improve this Doc View Source AddNewItemText Gets the actual AddNewItemText being used. Declaration public string AddNewItemText { get; } Property Value Type Description String | Improve this Doc View Source Method Gets the actual Method being used. Declaration public NewItemMethod Method { get; } Property Value Type Description NewItemMethod Methods | Improve this Doc View Source GetActionInfo() Gets a string containing information about the item to be rendered and the controller action to be called, either as a query string (for when using Get or JSON (for when using Post . Those instructions will be passed to the JavaScript scripts in the view to call the controller using Ajax. Declaration public string GetActionInfo() Returns Type Description String A string containing instructions on how to call the controller using Ajax. | Improve this Doc View Source GetItemCreateParameters() Creates a new AddNewDynamicItem object based on the information stored in this instance. Declaration public AddNewDynamicItem GetItemCreateParameters() Returns Type Description AddNewDynamicItem A new AddNewDynamicItem object. Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>)"
},
"api/DynamicVML.Internals.ListParameters.html": {
"href": "api/DynamicVML.Internals.ListParameters.html",
"title": "Class ListParameters | DVML",
"keywords": "Class ListParameters Represents a collection of read-only parameter values that are being used to currently render the list. Those cannot be changed after rendering has started. Inheritance Object Parameters ListParameters Inherited Members Parameters.ContainerId Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Internals Assembly : DynamicVML.dll Syntax public class ListParameters : Parameters Constructors | Improve this Doc View Source ListParameters(String, String, String, String, String, ListRenderMode) Creates a new instance of ListParameters . Declaration public ListParameters(string containerId, string itemTemplate, string itemContainerTemplate, string listTemplate, string prefix, ListRenderMode mode) Parameters Type Name Description String containerId String itemTemplate String itemContainerTemplate String listTemplate String prefix ListRenderMode mode Properties | Improve this Doc View Source ItemContainerTemplate Gets the actual ItemContainerTemplate being used. Declaration public string ItemContainerTemplate { get; } Property Value Type Description String | Improve this Doc View Source ItemTemplate Gets the actual ItemTemplate being used. Declaration public string ItemTemplate { get; } Property Value Type Description String | Improve this Doc View Source ListTemplate Gets the actual ListTemplate being used. Declaration public string ListTemplate { get; } Property Value Type Description String | Improve this Doc View Source Mode Gets the actual ListRenderMode being used. Declaration public ListRenderMode Mode { get; } Property Value Type Description ListRenderMode | Improve this Doc View Source Prefix Gets the actual HTML prefix being used for the forms. Declaration public string Prefix { get; } Property Value Type Description String Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>)"
},
"api/DynamicVML.Internals.Parameters.html": {
"href": "api/DynamicVML.Internals.Parameters.html",
"title": "Class Parameters | DVML",
"keywords": "Class Parameters Base class for ListParameters and ItemParameters . Inheritance Object Parameters ItemParameters ListParameters Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Internals Assembly : DynamicVML.dll Syntax public abstract class Parameters Constructors | Improve this Doc View Source Parameters(String) Creates a new instance of the Parameters class. Declaration public Parameters(string containerId) Parameters Type Name Description String containerId The HTML div element ID for the current list. Properties | Improve this Doc View Source ContainerId Gets the HTML div element ID for the current list. Declaration public string ContainerId { get; } Property Value Type Description String Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>)"
},
"api/DynamicVML.ListRenderMode.html": {
"href": "api/DynamicVML.ListRenderMode.html",
"title": "Enum ListRenderMode | DVML",
"keywords": "Enum ListRenderMode Represents different rendering modes for the final (user-provided) item template. Namespace : DynamicVML Assembly : DynamicVML.dll Syntax public enum ListRenderMode Fields Name Description ViewModelOnly The final user-provided item template expects an instance of their view model as the MVC @model class (e.g., \"BookViewModel\"). ViewModelWithOptions The final user-provided item template expects an instance of their custom options for their view model as the MVC @model class (e.g., \"TOptions<BookViewModel>\"). Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions, ListRenderMode>(String, Func<ListRenderMode, TViewModel>, Func<ListRenderMode, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, ListRenderMode>(String, Func<ListRenderMode, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, ListRenderMode>(String, Func<ListRenderMode, TOptions>)"
},
"api/DynamicVML.NewItemMethod.html": {
"href": "api/DynamicVML.NewItemMethod.html",
"title": "Enum NewItemMethod | DVML",
"keywords": "Enum NewItemMethod Represents different HTTP methods which can be used to retrieve new list items from the server. Default is to use Get . Namespace : DynamicVML Assembly : DynamicVML.dll Syntax public enum NewItemMethod Fields Name Description Get New items should be requested via GET. Post New items should be requested via POST. Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions, NewItemMethod>(String, Func<NewItemMethod, TViewModel>, Func<NewItemMethod, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, NewItemMethod>(String, Func<NewItemMethod, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, NewItemMethod>(String, Func<NewItemMethod, TOptions>)"
},
"api/DynamicVML.Options.DynamicListAttribute.html": {
"href": "api/DynamicVML.Options.DynamicListAttribute.html",
"title": "Class DynamicListAttribute | DVML",
"keywords": "Class DynamicListAttribute Represents an attribute which you can include in your view model's properties to indicate the property should be rendered as a Dynamic List. This class inherits from UIHintAttribute . Inheritance Object Attribute UIHintAttribute DynamicListAttribute Inherited Members UIHintAttribute.Equals(Object) UIHintAttribute.GetHashCode() UIHintAttribute.ControlParameters UIHintAttribute.PresentationLayer UIHintAttribute.UIHint Attribute.GetCustomAttribute(Assembly, Type) Attribute.GetCustomAttribute(Assembly, Type, Boolean) Attribute.GetCustomAttribute(MemberInfo, Type) Attribute.GetCustomAttribute(MemberInfo, Type, Boolean) Attribute.GetCustomAttribute(Module, Type) Attribute.GetCustomAttribute(Module, Type, Boolean) Attribute.GetCustomAttribute(ParameterInfo, Type) Attribute.GetCustomAttribute(ParameterInfo, Type, Boolean) Attribute.GetCustomAttributes(Assembly) Attribute.GetCustomAttributes(Assembly, Boolean) Attribute.GetCustomAttributes(Assembly, Type) Attribute.GetCustomAttributes(Assembly, Type, Boolean) Attribute.GetCustomAttributes(MemberInfo) Attribute.GetCustomAttributes(MemberInfo, Boolean) Attribute.GetCustomAttributes(MemberInfo, Type) Attribute.GetCustomAttributes(MemberInfo, Type, Boolean) Attribute.GetCustomAttributes(Module) Attribute.GetCustomAttributes(Module, Boolean) Attribute.GetCustomAttributes(Module, Type) Attribute.GetCustomAttributes(Module, Type, Boolean) Attribute.GetCustomAttributes(ParameterInfo) Attribute.GetCustomAttributes(ParameterInfo, Boolean) Attribute.GetCustomAttributes(ParameterInfo, Type) Attribute.GetCustomAttributes(ParameterInfo, Type, Boolean) Attribute.IsDefaultAttribute() Attribute.IsDefined(Assembly, Type) Attribute.IsDefined(Assembly, Type, Boolean) Attribute.IsDefined(MemberInfo, Type) Attribute.IsDefined(MemberInfo, Type, Boolean) Attribute.IsDefined(Module, Type) Attribute.IsDefined(Module, Type, Boolean) Attribute.IsDefined(ParameterInfo, Type) Attribute.IsDefined(ParameterInfo, Type, Boolean) Attribute.Match(Object) Attribute.TypeId Object.Equals(Object, Object) Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Options Assembly : DynamicVML.dll Syntax public class DynamicListAttribute : UIHintAttribute Remarks Instead of specifying each of your views to add the extra parameters to EditorFor() , you can alternatively configure the DynamicList properties of your view models directly in your view model class definition using this attribute: public class AuthorViewModel { public string FirstName { get; set; } public string LastName { get; set; } [Display(Name = \"Authored books\")] [DynamicList(\"BookView\", ItemContainerTemplate = \"MyCustomItemContainer\", ListTemplate = \"MyCustomList\", Method = RequestNewItemMethod.Post)] public virtual DynamicList<BookViewModel> Books { get; set; } = new DynamicList<BookViewModel>(); } Note While this is possible, this is not exactly recommended as one could argue that specifying view parameters in your view models may add unnecessary coupling between your code and the presentation layer. However, if you really want to specify parameters this way, the library will let you do so. Constructors | Improve this Doc View Source DynamicListAttribute(String) Initializes a new instance of the DynamicListAttribute class. Declaration public DynamicListAttribute(string listContainerTemplate = \"DynamicListContainer\") Parameters Type Name Description String listContainerTemplate The template for the list container. For more details about the different regions associated with a DynamicList<TViewModel, TOptions> , please EditorExtensions . Properties | Improve this Doc View Source ItemContainerTemplate Gets or sets the item container template to be used when displaying a list for this attribute. For more details about the different regions associated with a DynamicList<TViewModel, TOptions> , please EditorExtensions . Declaration public string ItemContainerTemplate { get; set; } Property Value Type Description String | Improve this Doc View Source ItemTemplate Gets or sets the item template to be used when displaying a list for this attribute. This should normally be your view for the view models you are using. If you do not specify a view name, the library will attempt to find one based on your view model's class name. For more details about the different regions associated with a DynamicList<TViewModel, TOptions> , please EditorExtensions . Declaration public string ItemTemplate { get; set; } Property Value Type Description String | Improve this Doc View Source ListContainerTemplate Gets or sets the list container template to be used when displaying a list for this attribute. For more details about the different regions associated with a DynamicList<TViewModel, TOptions> , please EditorExtensions . Declaration public string ListContainerTemplate { get; } Property Value Type Description String | Improve this Doc View Source ListTemplate Gets or sets the list template to be used when displaying a list for this attribute. For more details about the different regions associated with a DynamicList<TViewModel, TOptions> , please EditorExtensions . Declaration public string ListTemplate { get; set; } Property Value Type Description String | Improve this Doc View Source Method Gets or sets whether to use Get or Post when requesting new list items from the server. Default is to use Get . Declaration public NewItemMethod Method { get; set; } Property Value Type Description NewItemMethod | Improve this Doc View Source Mode Gets or sets whether the view for your viewmodel should receive a @model of type YourOptions<YourViewModel> or simply YourViewModel . Default is to use ViewModelOnly (so your view will receive just your view model, without its associated options object. Declaration public ListRenderMode Mode { get; set; } Property Value Type Description ListRenderMode Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) See Also UIHintAttribute"
},
"api/DynamicVML.Options.DynamicListDisplayOptions.html": {
"href": "api/DynamicVML.Options.DynamicListDisplayOptions.html",
"title": "Class DynamicListDisplayOptions | DVML",
"keywords": "Class DynamicListDisplayOptions Represents different options that can be used when displaying a DynamicList<TViewModel, TOptions> . Instances of this class are normally created internally by the library when calling the DisplayListFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, Object, ListRenderMode) extension method provided by this library. Inheritance Object DynamicListOptions DynamicListDisplayOptions Inherited Members DynamicListOptions.ItemTemplate DynamicListOptions.ItemContainerTemplate DynamicListOptions.ListTemplate DynamicListOptions.Mode Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Options Assembly : DynamicVML.dll Syntax public class DynamicListDisplayOptions : DynamicListOptions Remarks An instance of this class may be present in the ViewData dictionaries for your view. If you would like to access this object, use the value of ItemDisplayParameters as the ViewData key. Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) See Also DynamicListEditorOptions"
},
"api/DynamicVML.Options.DynamicListEditorOptions.html": {
"href": "api/DynamicVML.Options.DynamicListEditorOptions.html",
"title": "Class DynamicListEditorOptions | DVML",
"keywords": "Class DynamicListEditorOptions Represents different options that can be used when displaying a DynamicList<TViewModel, TOptions> for edigint. Instances of this class are normally created internally by the library when calling the ListEditorFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, String, String, Object, ListRenderMode, NewItemMethod) extension method provided by this library. Inheritance Object DynamicListOptions DynamicListEditorOptions Inherited Members DynamicListOptions.ItemTemplate DynamicListOptions.ItemContainerTemplate DynamicListOptions.ListTemplate DynamicListOptions.Mode Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Options Assembly : DynamicVML.dll Syntax public class DynamicListEditorOptions : DynamicListOptions Remarks An instance of this class may be present in the ViewData dictionaries for your view. If you would like to access this object, use the value of ListEditorParameters as the ViewData key. Properties | Improve this Doc View Source ActionUrl Gets or sets the path to your controller's action which will be responsible for rendering a new item to be added to the list. Please see the sample applications for an example on how they are set up. Declaration public string ActionUrl { get; set; } Property Value Type Description String | Improve this Doc View Source AddNewItemText Gets or sets the text that gets displayed on the \"Add New Item\" link that will call the server to dynamically add a new item to the list. The default is to use \"Add new {name of your view model}\". Declaration public string AddNewItemText { get; set; } Property Value Type Description String | Improve this Doc View Source Method Gets or sets whether to use Get or Post when requesting new list items from the server. Default is to use Get . Declaration public NewItemMethod? Method { get; set; } Property Value Type Description Nullable < NewItemMethod > Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) See Also DynamicListDisplayOptions"
},
"api/DynamicVML.Options.DynamicListOptions.html": {
"href": "api/DynamicVML.Options.DynamicListOptions.html",
"title": "Class DynamicListOptions | DVML",
"keywords": "Class DynamicListOptions Base class for DynamicListDisplayOptions and DynamicListEditorOptions . Inheritance Object DynamicListOptions DynamicListDisplayOptions DynamicListEditorOptions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : DynamicVML.Options Assembly : DynamicVML.dll Syntax public abstract class DynamicListOptions Remarks The properties of this class specify templates for different regions of the dynamic list when it gets rendered into a view. A quick reference for the regions can be seen in the figure below: Properties | Improve this Doc View Source ItemContainerTemplate Gets or sets the item container template to be used when displaying a list for this attribute. For more details about the different regions associated with a DynamicList<TViewModel, TOptions> , please EditorExtensions . Declaration public string ItemContainerTemplate { get; set; } Property Value Type Description String | Improve this Doc View Source ItemTemplate Gets or sets the item template to be used when displaying a list for this attribute. This should normally be your view for the view models you are using. If you do not specify a view name, the library will attempt to find one based on your view model's class name. For more details about the different regions associated with a DynamicList<TViewModel, TOptions> , plase EditorExtensions . Declaration public string ItemTemplate { get; set; } Property Value Type Description String | Improve this Doc View Source ListTemplate Gets or sets the list template to be used when displaying a list for this attribute. For more details about the different regions associated with a DynamicList<TViewModel, TOptions> , please EditorExtensions . Declaration public string ListTemplate { get; set; } Property Value Type Description String | Improve this Doc View Source Mode Gets or sets whether the view for your viewmodel should receive a @model of type YourOptions{YourViewModel} or simply YourViewModel . Default is to use ViewModelOnly (so your view will receive just your view model, without its associated options object. Declaration public ListRenderMode? Mode { get; set; } Property Value Type Description Nullable < ListRenderMode > Extension Methods EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions) EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String) EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>) EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>) EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>) See Also DynamicListEditorOptions DynamicListDisplayOptions"
},
"api/DynamicVML.Options.html": {
"href": "api/DynamicVML.Options.html",
"title": "Namespace DynamicVML.Options | DVML",
"keywords": "Namespace DynamicVML.Options Classes DynamicListAttribute Represents an attribute which you can include in your view model's properties to indicate the property should be rendered as a Dynamic List. This class inherits from UIHintAttribute . DynamicListDisplayOptions Represents different options that can be used when displaying a DynamicList<TViewModel, TOptions> . Instances of this class are normally created internally by the library when calling the DisplayListFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, Object, ListRenderMode) extension method provided by this library. DynamicListEditorOptions Represents different options that can be used when displaying a DynamicList<TViewModel, TOptions> for edigint. Instances of this class are normally created internally by the library when calling the ListEditorFor<TModel, TValue>(IHtmlHelper<TModel>, Expression<Func<TModel, TValue>>, String, String, String, String, String, String, Object, ListRenderMode, NewItemMethod) extension method provided by this library. DynamicListOptions Base class for DynamicListDisplayOptions and DynamicListEditorOptions ."
},
"index.html": {
"href": "index.html",
"title": "Dynamic View-Model Lists | DVML",
"keywords": "ynamic View-Model Lists The Dynamic View Model Lists library (DVML) provides a templating engine to render dynamic item lists in ASP.NET. A dynamic list is a list inside an HTML form where the user can add new items to a list after the page has been rendered. In ASP.NET, the default model binder makes certain assumptions to determine the name of the fields in the form and how they should be posted back to the server. Using this library, those assumptions are always fulfilled and your forms posted correctly. This library provides an alternative to the EditorForMany extension by @mattalun and BeginCollectionItem by Steve Sanderson . However, it supports nested lists of any depth, does not require adding an extra Index field to your existing models or view models, and suports multiple editor and display templates for your items. The library can also make your controllers include additionalViewData that had been specified in your view without cluttering your controller code with too many details about the view. In addition, the library can also handle requests sent by either GETs or POSTs. Getting started To get started, start by adding a reference to the DynamicVML NuGet package in your project: dotnet add package DynamicVML After adding the package, you just have to perform four steps to get it running: 1. Add script references Add a reference to ~/lib/dynamic-viewmodel-list/dvml.js to your view, e.g. , either by adding it to your _Layout.cshtml file or to the Scripts section usually located at the bottom of your Create , Edit , Details , and/or Delete.cshtml view files: @section Scripts { <!-- Load JS code for the Dynamic ViewModel Lists above --> <script src=\"~/lib/dynamic-viewmodel-list/dvml.js\"></script> } Note The include above should work even though you will notice that this file will not be physically present in your wwwroot folder. That's because the library is implemented as a .NET Core App 3.1 Razor Class Library (RCL) and the .js is embedded within the library .DLLs. 2. Replace relevant usages of List<T> with DynamicList<T> Update your view models to use DynamicList<T> instead of List<T> for any collections you want to support client-side dynamic insertion: public class AuthorViewModel { [Display(Name = \"First name\")] public string FirstName { get; set; } [Display(Name = \"Last name\")] public string LastName { get; set; } [Display(Name = \"Authored books\")] public virtual DynamicList<BookViewModel> Books { get; set; } = new DynamicList<BookViewModel>(); // <---- } 3. Add actions that create new items to your controllers Add an action to your controller to create a new view model item upon request: public IActionResult AddBook(AddNewDynamicItem parameters) { var newBookViewModel = new BookViewModel() { Title = \"New book\" }; return this.PartialView(newBookViewModel, parameters); } 4. Use ListEditorFor() and DisplayListFor() in your views Update your view to use a the extension method Html.ListEditorFor() method that takes the name of the method above and a text to be rendered as the \"add new item\" button as an argument: <div> <h3>Books</h3> @Html.ListEditorFor(x => x.Books, Url.Action(\"AddBook\"), \"Add new book\") </div> Features The library provides a templating mechanism and an options mechanism so you can customize your lists without having to perform too many changes to your existing view models. Using templates to customize list rendering The library assumes that you already have defined reusable views for the many multiple view models you might have in your project. For example, a common approach for reuse would be to define a common \"Address.cshtml\" view that could render an AddressViewModel in different sections of your application. With this assumption in mind, it would have been a lot of trouble if you had to create separate views for each common kind of list items you would like to add to your project, e.g. , lists for PhoneViewModel s, AddressViewModel s and so on. That is why, using this library, you can specify which template view you would like to use for each part of the list directly when creating your view. For instance, let's say you would like to render a list of AddressViewModel s with one layout, and a list of PhoneViewModel s with a different layout. Then you could use: @Html.ListEditorFor(x => x.Addresses, Url.Action(\"AddAddress\"), \"Add new address\", listContainerTemplate: \"CustomListContainerTemplateWithBellsAndWhistles\") or @Html.ListEditorFor(x => x.Phones, Url.Action(\"AddPhone\"), \"Add new phone\", listContainerTemplate: \"CustomListContainerTemplateWithFancyButton\") Now, note that the list templates do not have any knowledge of your view models. They are completely reusable for different regions of your application, with any ViewModel you would like to use. Note The library can guess common names for the view, the action, and even the \"add new item\" texts from the name of your ViewModel, so they do not really need to be specified when calling Html.ListEditorFor() . However, specifying the view is strongly advised in order to avoid unnecessary server-side processing. The library assumes dynamic lists are composed of four main (fully customizable) regions: A region that contains the list ( which the library refers to as DynamicListContainers ) The list ( which the library refers to as DynamicList ) Regions that contain the list items ( which the library refers to as DynamicItemContainers ) The list items ( which are your already existing views ) You can specify templates for each of those regions using: @Html.DisplayListFor(x => x.Books, itemTemplate: \"BookViewModel\", itemContainerTemplate: \"MyItemContainerTemplate\" listTemplate: \"MyListTemplate\" listContainerTemplate: \"MyListContainerTemplate\") or @Html.ListEditorFor(x => x.Books, itemTemplate: \"BookViewModel\", itemContainerTemplate: \"MyItemContainerTemplate\" listTemplate: \"MyListTemplate\" listContainerTemplate: \"MyListContainerTemplate\") A default template will be used for regions that have not been specified. The meaning of each region is shown in the figure below: Note that each of those regions are completely oblivious of each other and can be replaced at will, without having to create different views for each configuration. All you have to do is specify templates for them when calling ListEditorFor() in your view. If you do not specify the template for some region, the library will use default ones that can be obtained either from the library itself, or by searching for .cshtml files in your application that have the same name as the default templates. Custom reusable options Now, a common task is to be able to customize each of the item containers with some buttons ( e.g. to remove the item, collapse the item, or display extra information about what the user is entering). Furthermore, you may want only some items to be removable, but not all of them ( e.g. the first address in a list of addresses could be mandatory and non-removable). Instead of having to add each of those options to your ViewModels and thus maybe having multiple different ViewModels for different configurations of your items, you can instead specify item options for each of your items directly from your view or controller: public IActionResult AddBook(AddNewDynamicItem parameters) { var newBookViewModel = new BookViewModel() { Title = \"New book\", PublicationYear = \"1994\" }; return this.PartialView(newBookViewModel, parameters, new MyOptions<BookViewModel>() { CardTitle = \"Dynamic item\", CardSubtitle = \"You cannot remove this item\", CanRemove = false }); } The MyOptions<T> can be considered a separate view model on its own, that you can customize yourself, adding any options you may want, e.g. : public class MyOptions<T> : DynamicListItemOptions<T>, IMyOptions where T : class { public string CardTitle { get; set; } public string CardSubtitle { get; set; } public bool CanRemove { get; set; } } As you can see, this mechanism is highly useful for using with front-end frameworks like Bootstrap (where you could bind the CardTitle and CardSubtitle to Bootstrap Cards ), without adding strong coupling with a particular framework. The view for your options and the both the view and the view models for your entities are completely independent from your MyOptions<T> ViewModel. Avoid touching the view at all Instead of specifying each of your views to add the extra parameters to ListEditorFor() , you can alternatively configure the DynamicList properties of your view models directly in your view model class definition using attributes: public class AuthorViewModel { public string FirstName { get; set; } public string LastName { get; set; } [Display(Name = \"Authored books\")] [DynamicList(\"BookView\", ItemContainerTemplate = \"MyCustomItemContainer\", ListTemplate = \"MyCustomList\", Method = RequestNewItemMethod.Post)] public virtual DynamicList<BookViewModel> Books { get; set; } = new DynamicList<BookViewModel>(); } Note While this is possible, this is not exactly recommended as one could argue that specifying view parameters in your view models may add unnecessary coupling between your code and the presentation layer. However, if you really want to do this, the library will let you do so. Passing custom additionalViewData to dynamic list items Maybe in your project you might have the need to pass different parameters to your views by passing anonymous objects to the additionalViewData parameter of ListEditorFor() . However, when a user requests a new list item to be added to the form, it is the controller's task to create a new partial view to be sent to the client, and the additionalViewData you have specified in the creation of the view will not be available from the controller's side. In order to address this situation, the library can serialize your custom objects into JSON UTF-8 byte arrays and keep them hidden in the HTML of the form at the client side. When the user requests a new item, the ajax call to the server will include the serialized additional data that will then be passed seamlessy to the new partial view, keeping the original behavior of your views working. @Html.ListEditorFor(x => x.Phones, Url.Action(\"AddPhone\"), \"Add new phone\", method: RequestNewItemMethod.Post, additionalViewData: new { MyCustomData = \"some attribute I can only compute from the view\" }) Note Passing additional view data to the client requires also specifying method: RequestNewItemMethod.Post since the additional data may be too long to be included in a GET query string. Warning While the library supports this scenario, it may not be advisable to actually make use of this since there may be other cleaner ways to pass user data to your views, e.g. with proper properties in your view models. A malicious user could also tamper with the stored data and let the form submit altered data to your server. However, again, if you really need this functionality and understand the risks, the library will also let you do so. Passing custom action parameters to your controller Please note that you are not restricted to have only the AddNewDynamicItem as the single parameter in your controller actions. If desired, you can include further parameters. For example, consider the case where we would like to pass extra string and integer parameters: public IActionResult AddBook(AddNewDynamicItem parameters, string parameter1, int parameter2) { var newBookViewModel = new BookViewModel() { Title = $\"New book with parameter values {parameter1} and {parameter2}\" }; return this.PartialView(newBookViewModel, parameters); } In this case, we should be able to call our parameterized controller action from our view using: @Html.ListEditorFor(x => x.Books, action: Url.Action(\"AddBook\", \"BooksControllerName\", new { parameter1: \"some text\", parameter2: 42, }), addNewItemText: \"Add new book\", And the above should work both by both GET and POST. Note Because the additional action parameters are encoded in the query string (even when using POST), you may only be able to pass strings , primitive types ( e.g. , int , bool , double , float ), and other simple parameters that can be converted to and from strings ( e.g. , TimeSpan , DateTime , Guid ). Related links Alternative approaches & more information on ASP.NET's binding mechanism: https://www.mattlunn.me.uk/blog/2014/08/how-to-dynamically-via-ajax-add-new-items-to-a-bound-list-model-in-asp-mvc-net/ http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/ https://tuanmsp.wordpress.com/2017/04/25/aspnet-editorfor-with-list-and-add-more-item-to-list-with-ajax/ https://dapper-tutorial.net/knowledge-base/53601008/dynamic-add-and-edit-of-data-in-asp-net-mvc-using-razor-view https://blog.rsuter.com/asp-net-mvc-how-to-implement-an-edit-form-for-an-entity-with-a-sortable-child-collection/ StackOverflow questions this library should address: https://stackoverflow.com/questions/14038392/editorfor-ienumerablet-with-templatename https://stackoverflow.com/questions/25333332/correct-idiomatic-way-to-use-custom-editor-templates-with-ienumerable-models-in https://stackoverflow.com/questions/36171865/dynamic-partial-view-list-not-being-picked-up-when-saving https://stackoverflow.com/questions/52305337/how-do-i-use-the-editorformany-html-helper-in-net-core https://stackoverflow.com/questions/42116800/editorformany-not-working-for-objects-deeper-than-1-level https://stackoverflow.com/questions/29324837/add-related-entities-with-asp-net-mvc-and-razor https://stackoverflow.com/questions/9915612/how-can-i-add-rows-to-a-collection-list-in-my-model Unrelated links I have recently created another library for ASP.NET called System.Enums.FontAwesome (sefa) . It provides strongly-typed enumerations that can be used to list icons from https://fontawesome.com/ . Enumeration members are marked with DisplayAttributes to make them suitable for being bound to user controls such as selectlists and comboboxes. Other of my projects include: Accord.NET - one of the earliest and most complete machine learning libraries for .NET/C#. Statistics Workbench - a tool to help teaching introductory classes on statistics, made in WPF. Procedural Human Action Videos - a dataset for learning computer vision models using procedural generation. License This library is licensed under the MIT license . The library logo is based on the fa-stream icon from Font Awesome and is licensed under the Creative Commons Attribution 4.0 International license ."
},
"samples.html": {
"href": "samples.html",
"title": "Sample applications | DVML",
"keywords": "Sample applications You can find sample applications on the project's GitHub page which can help demonstrate how this library can be used. Those are: Books and authors Browse the source: dynamic-vml/sample-netcoreapp3.1-books-and-authors-simple Download it as a .zip: master.zip This sample application demonstrates how to consume the DynamicVML RCL from a .NET Core App 3.1 application running ASP.NET MVC for presentation and Entity Framework Core for persistence. It consists of a simple CRUD example where you can list, add, edit, and delete book authors and include details about the books they have written. The books are added and removed from the CRUD pages using DynamicVML. Books and authors (customized layouts) Browse the source: dynamic-vml/sample-netcoreapp3.1-books-and-authors-options Download it as a .zip: master.zip This version of the sample application shows how to customize the layouts of the lists and how to create view models for display options associated with each item in a list, e.g., titles and subtitles for Bootstrap Cards . Books and authors (parameterized templates) Browse the source: dynamic-vml/sample-netcoreapp3.1-books-and-authors-parameters Download it as a .zip: master.zip This version of the sample application shows how to create parameterized templates that can have their behaviour customized depending on additional view data specified inside the view (.cshtml). This sample also shows how to make the user request new items to be added to the list via POST . Razor Class Libraries (RCL) Those examples, together with the library iself , can also serve as an example on how to create a reusable Razor Class Library (RCL) that contain static resources and how to consume it from your applications in .NET Core 3.1. There is currently some confusion on how to achieve this due the significant amount of outdated tutorials and Stackoverflow answers out there. Here is the .csproj configuration for the library . Here are the Program.cs and Startup.cs for the consumer applications. Tip Never use the standalone nuget.exe to pack Razor libraries. Always use dotnet nuget pack instead. They are completely different beasts."
}
}