public void SetValue(long fieldId, string value)
        {
            var entityVal = Meridian.Default.field_valuesStore.All().FirstOrDefault(s
                => s.proto_name == m_Parent.ProtoName && s.entity_id == m_Parent.id
                && s.field_id == fieldId);

            if (entityVal == null)
            {
                entityVal = new field_values
                    {
                        proto_name = m_Parent.ProtoName,
                        field_id = fieldId,
                        entity_id = m_Parent.id,
                    };

                Meridian.Default.field_valuesStore.Insert(entityVal);
            }

            entityVal.field_value = value;

            Meridian.Default.field_valuesStore.Update(entityVal);
        }
示例#2
0
 public field_values RemoveFieldValues(field_values _item, bool _complete = false)
 {
     fv_entity_fields.Remove(_item);
     if(_complete) Meridian.Default.field_valuesStore.Delete(_item);
     return _item;
 }
示例#3
0
 public field_values AddFieldValues(field_values _item, bool _insertToStore = false)
 {
     if(fv_entity_fields.IndexOf(_item) != -1) return _item;
     fv_entity_fields.Add(_item);
     _item.field_id = id;
     if(_insertToStore && !Meridian.Default.field_valuesStore.Exists(_item.id))
     {
         Meridian.Default.field_valuesStore.Insert(_item);
         _item.LoadAggregations(Meridian.Default);
     }
     return _item;
 }