private void AssignGuid(Floor floor, Guid guid, Schema instanceSchema, int run, string nickName) { Entity entity = null; try { entity = floor.GetEntity(instanceSchema); } catch (Exception ex) { Debug.Write("Error", ex.Message); } try { if (!entity.IsValid()) { entity = new Entity(instanceSchema); } Field field = instanceSchema.GetField("InstanceID"); entity.Set<string>(field, guid.ToString()); field = instanceSchema.GetField("RunID"); entity.Set<int>(field, run); field = instanceSchema.GetField("NickName"); entity.Set<string>(field, nickName); floor.SetEntity(entity); } catch (Exception ex) { TaskDialog.Show("Error", ex.Message); } }