我的.Net Core MVC项目中出现了一个奇怪的错误。它告诉我:类型或命名空间名称'Tripmetadata'在名称空间'MSPFrontend.Models'中不存在(你是否缺少程序集引用?)
我有很多观点正在使用此文件夹中的模型而没有任何问题。在我的_ViewImports.cshtml
我有:
@using MSPFrontend.Models
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace MSPFrontend.Models
{
public partial class Tripmetadata
{
public Tripmetadata()
{
Tripgpsdata = new HashSet<Tripgpsdata>();
Tripstate = new HashSet<Tripstate>();
}
[Key]
public int Tripid { get; set; }
[Display(Name = "Start Timestamp")]
public long? Starttimestamp { get; set; }
[Display(Name = "End Timestamp")]
public long? Endtimestamp { get; set; }
public long? Duration { get; set; }
[Display(Name = "Average Speed")]
public decimal? AvgSpeed { get; set; }
public decimal? Distance { get; set; }
public virtual ICollection<Tripgpsdata> Tripgpsdata { get; set; }
public virtual ICollection<Tripstate> Tripstate { get; set; }
}
}