Cleanup and fixes
This commit is contained in:
@@ -34,7 +34,7 @@ namespace MileageTraker.Web.ViewModels.CreateLog
|
||||
public MileageLogTypeWrapper LogType { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Required")]
|
||||
[Display(Name = "City Name")]
|
||||
[Display(Name = "Destination City")]
|
||||
[InputSize("medium")]
|
||||
[StringLength(64, MinimumLength = 3, ErrorMessage = "Minimum 3 characters")]
|
||||
public string CityName { get; set; }
|
||||
@@ -64,6 +64,12 @@ namespace MileageTraker.Web.ViewModels.CreateLog
|
||||
Mapper.CreateMap<CreateLogViewModel, Models.Log>();
|
||||
}
|
||||
|
||||
public CreateLogViewModel()
|
||||
{
|
||||
// view will crash if this isn't instantiated
|
||||
LogType = new MileageLogTypeWrapper();
|
||||
}
|
||||
|
||||
public Models.Log GetLog()
|
||||
{
|
||||
var log = new Models.Log();
|
||||
|
||||
Reference in New Issue
Block a user