Add VehiclePreviousLog
This commit is contained in:
@@ -70,6 +70,12 @@ namespace MileageTraker.Web.Models
|
||||
[HiddenInput]
|
||||
public string UserAgent { get; set; }
|
||||
|
||||
[HiddenInput]
|
||||
public int? VehiclePreviousLogId { get; set; }
|
||||
|
||||
[HiddenInput]
|
||||
public virtual Log VehiclePreviousLog { get; set; }
|
||||
|
||||
public Log()
|
||||
{
|
||||
LogType = new MileageLogTypeWrapper();
|
||||
|
||||
@@ -12,6 +12,10 @@ namespace MileageTraker.Web.Models
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
|
||||
modelBuilder.Entity<Log>()
|
||||
.HasOptional(l => l.VehiclePreviousLog)
|
||||
.WithMany()
|
||||
.HasForeignKey(l => l.VehiclePreviousLogId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user