I have the following calculated field in Vendor.cs:
public string FullAddress
{
get
{
return VendorAddNum + " " + TLRoadDirection.Direction + " " + VendorAddName + " " + TLRoadType.RdType + " " + TLUnitTypeOne.UnitType + " " + VendorAddUnitOne + " " + TLUnitTypeTwo.UnitType + " " + VendorAddUnitTwo;
}
}
Here's the markup from the view for the field:
@Html.DisplayNameFor(model => model.FullAddress)
When one of my vendors doesn't have any address information, FullAddress is null, which causes me to get a null reference exception. How can I allow FullAddress to be null?