我收到以下错误
无法隐式转换类型“System.Guid?” 到“DataContracts.Market”
private CellSite MapEntityToCellSitePOCO(t_CellSite _cellsite)
{
CellSite cellsite= new CellSite();
cellsite.SiteId = _cellsite.SiteID;
cellsite.Market.MarketID = _cellsite.MarketId;
cellsite.Region.RegionId = _cellsite.RegionId;
return cellsite;
}
以下是我的数据合同文件
public class CellSite
{
public Guid CellSiteID { get; set; }
public string SiteId { get; set; }
public Region Region { get; set; }
public Market Market { get; set; }
public Guid? ConstructionManager { get; set;}
}
这是market.cs
public class Market
{
public Guid? MarketID { get; set; }
public string OperatorMarketName { get; set; }
public string MarketName { get; set; }
public decimal AllOtherAmount { get; set; }
public decimal RawLandAmount { get; set; }
public decimal RenewalFee { get; set; }
public bool IsActive { get; set; }
}
我想在 cellsite 表中有一个 MarketId 列。我该怎么做?我是实体框架工作的新手。提前致谢