I have one project in mvc.
i have employee model file with me that's is an dll file code
which defines all the fields of my form , i want to change the
[DataMember(IsRequired = false)]
for LName field
but as i have model file in term of dll i could not able to change it in .cs file
is there any other way?
code in .cs
[DataMember(IsRequired = true)]
[Display(Name = "Lname")]
[Metadata(MetadataId = "142C8DF5-0546-4C4A-A935-CA39D5AF0E2F", Order = 10, IsSearchable = true, IsVisible = true, IsReadonly = false, IsNullable = false, HasDefaultValue = false, DefaultValue = "")]
[Required(ErrorMessage = "Please enter Last Name")]
public double LName { get; set; }
code in .cshtml
<tr>
<td valign="top" class="nd_nor_ftd">Last Name
<span class="mand">*</span>
</td>
<td>
@Html.TextBoxFor(t => t.LName, new { @class = "smallTxtEntry" })
</tr>
In simple words I want to change that Isrequired field to false which is given as true? Or it should not give any validation error for this field help me