Код: Выделить всё
using System.Data.Linq.Mapping;
[Table(Name = "Members")]
public class MembersClass
{
[column]
public Guid guid {get; set;}
}
Код: Выделить всё
**System.InvalidCastException**: 'Specified cast is not valid.'
Код: Выделить всё
[Column(Name = "guid", DbType="uniqueidentifier" IsDbGenerated = true, AutoSync = AutoSync.OnInsert)]
public Guid? guid { get { return guid; } set { guid = Guid.TryParse(value.ToString(), out Guid g)?(Guid)g :(Guid?) null; }
}
Следующий шаг — создать искусственный Guid в виде varchar в базе данных
Подробнее здесь: https://stackoverflow.com/questions/798 ... -to-a-guid
Мобильная версия