diff --git a/src/chapters/aspdotnet-model-validation/validation-attributes.rst b/src/chapters/aspdotnet-model-validation/validation-attributes.rst index 4f3a5060..623e0713 100644 --- a/src/chapters/aspdotnet-model-validation/validation-attributes.rst +++ b/src/chapters/aspdotnet-model-validation/validation-attributes.rst @@ -1,7 +1,8 @@ Validation Attributes ===================== -Within the ViewModel or model of a C# web application, we can define validation rules using attributes. +Within the ViewModel or model of a C# web application, +we can define validation rules using attributes. Validation attributes can be applied to model fields. .. index:: @@ -12,7 +13,8 @@ Validation attributes can be applied to model fields. Common Attributes ------------------ -We'll use only a few of these attributes, but you can find a full list in the `documentation `_. +We'll use only a few of these attributes, but you can find a +full list in the `documentation `_. .. list-table:: Common Validation Attributes :header-rows: 1 diff --git a/src/chapters/aspdotnet-model-validation/validation-views.rst b/src/chapters/aspdotnet-model-validation/validation-views.rst index fa625544..0440dc56 100644 --- a/src/chapters/aspdotnet-model-validation/validation-views.rst +++ b/src/chapters/aspdotnet-model-validation/validation-views.rst @@ -83,7 +83,7 @@ In the ``Add`` View, you will need to add more ``class`` attributes for the libr -Note in line 10 the addition of ``class="form-control`` and in line 11 ``class="text-danger"``. +Note in line 10 the addition of ``class="form-control"`` and in line 11 ``class="text-danger"``. These attributes will be noted by the jQuery Unobtrusive Validation library and print our red if the client does not meet the requirements. diff --git a/src/chapters/enums/enums-in-models.rst b/src/chapters/enums/enums-in-models.rst index a6d8ebdc..6eb2afce 100644 --- a/src/chapters/enums/enums-in-models.rst +++ b/src/chapters/enums/enums-in-models.rst @@ -1,7 +1,9 @@ Enums in Model Classes ====================== -One application of enum types is to represent categories of objects. We will take this approach in our ``CodingEvents`` application to categorize events based on their type, such as *conference* or *meetup*. +One application of enum types is to represent categories of objects. +We will take this approach in our ``CodingEvents`` application to +categorize events based on their type, such as *conference* or *meetup*. Enum Types in Models - Video ---------------------------- @@ -11,8 +13,11 @@ Enum Types in Models - Video .. admonition:: Note - If you ever want to verify what code the video starts with, check out the `display-error-messages `__ branch in ``CodingEventsDemo``. - If you ever want to verify what code the video ends with, check out the `enums `__ branch in ``CodingEventsDemo``. + If you ever want to verify what code the video starts with, + check out the `display-error-messages `__ \ + branch in ``CodingEventsDemo``. If you ever want to verify what code the video ends with, + check out the `enums `__ + branch in ``CodingEventsDemo``. Enum Types in Models - Text --------------------------- @@ -53,7 +58,8 @@ we create a ``Type`` property in ``Event`` amongst the other properties declared // Event methods -Once we have added an ``EventType`` property to our model, we need to add an ``EventType`` property to our ViewModel. +Once we have added an ``EventType`` property to our model, we need to add an +``EventType`` property to our ViewModel. Add an Enum Property to a ViewModel ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -67,7 +73,8 @@ The first thing we need to do is add an ``EventType`` property to ``AddEventView public EventType Type { get; set; } -Now that we have a property to hold the event type that the user selects, we need to create a list of all of the possible event types. +Now that we have a property to hold the event type that the user selects, +we need to create a list of all of the possible event types. We will use this list to populate the ``select`` element in a later step. .. sourcecode:: csharp @@ -82,13 +89,17 @@ We will use this list to populate the ``select`` element in a later step. }; Because the ``EventType`` options are not changing, we can populate this property with a default value. -We add each of the constants to the ``EventTypes`` list. ``SelectListItem`` is an ASP.NET-provided class that represents each ``