Trying to insert GUID
as primary key within object
get
set
. In the set
section I checked if value==null
to determine insert
or update
.
public string Id
{
get
{
return this.Id;
}
set
{
try
{
this.Id = value == null ? this.Id = Guid.NewGuid().ToString("D") : value;
}
catch (Exception ex) {
throw ex;
}
}
}