---
title: "Cannot implicitly convert type &#39;System.Guid"  
description: "Cannot implicitly convert type &#39;System.Guid"  
author: "Anonymous User"  
published: 2014-08-29  
updated: 2014-09-01  
canonical: https://www.mindstick.com/forum/2198/cannot-implicitly-convert-type-39-system-guid  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Cannot implicitly convert type &#39;System.Guid

I [am getting](https://www.mindstick.com/forum/34179/i-am-getting-error-while-assigning-the-data-to-the-array-list) the following [error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing)

[Cannot implicitly](https://www.mindstick.com/forum/34469/cannot-implicitly-convert-type-long-to-long) [convert](https://www.mindstick.com/forum/2093/configurationmanager-appsettings-convert-n-to-n-why) type 'System.Guid?' to 'DataContracts.[Market](https://yourviews.mindstick.com/view/85538/explore-top-10-electric-cars-in-usa-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;    }
```

the following is my datacontracts file

```
    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;}   }
```

This is 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; }}
```

there is a [column](https://www.mindstick.com/forum/33860/how-to-calculate-column-summary-in-sql-server) MarketId in cellsite [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) which i want to bring on.how can i do that? I am new to [entity](https://www.mindstick.com/forum/160562/database-connectivity-using-entity-framework-database-first-approach) [frame](https://www.mindstick.com/articles/749/html-frames) work. thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

## Replies

### Reply by Sumit Kesarwani

You have to initialize your Market and Region properties first:

CellSite cellsite= new CellSite();

cellsite.SiteId = _cellsite.SiteID;

cellsite.Market = new Market();

cellsite.Market.MarketID = _cellsite.MarketId;

cellsite.Region = new Region();

cellsite.Region.RegionId = _cellsite.RegionId;


---

Original Source: https://www.mindstick.com/forum/2198/cannot-implicitly-convert-type-39-system-guid

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
