jeudi 19 mars 2015

WCF based External List Columns Type in Sharepoint 2010



In my Sharepoint 2010 I've created External List that uses WCF service as data source. This is my data type that is exposed by the service:



[DataContract]
public class Item
{
[DataMember]
public Guid Id { get; set; }

[DataMember]
public string Name { get; set; }

[DataMember]
public string Description { get; set; }
}


Everything is fine as long as I'm using simple types such as string, int, bool. This types are mapped to Sharepoint types without any issue.


Now I what to use something more complex.



[DataContract]
public class Item
{
[DataMember]
public Guid Id { get; set; }

[DataMember]
public string Name { get; set; }

[DataMember]
public string Description { get; set; }

[DataMember]
public Uri Link { get; set; }
}


I've added Link property of type Uri. By default this field does not appear in my list at all because, as far as I understand, sharepoint doesn't know how to map this property. I would like to map it to field of type Hyperlink or Picture.


Is there any way to explicitly define to which type I want my property to be mapped to? I can use another type in my Item class if necessary.








0 commentaires:

Enregistrer un commentaire