ContentFieldDefinition Build(ContentFieldDefinitionRecord source)
 {
     return source == null ? null : new ContentFieldDefinition(source.Name);
 }
 private ContentFieldDefinitionRecord Acquire(ContentFieldDefinition contentFieldDefinition)
 {
     var result = GetContentDefinitionRecord().ContentFieldDefinitionRecords.SingleOrDefault(x => x.Name == contentFieldDefinition.Name);
     if (result == null)
     {
         result = new ContentFieldDefinitionRecord { Name = contentFieldDefinition.Name };
         GetContentDefinitionRecord().ContentFieldDefinitionRecords.Add(result);
     }
     return result;
 }
 ContentFieldDefinition Build(ContentFieldDefinitionRecord source) {
     return new ContentFieldDefinition(source.Name);
 }
 private ContentFieldDefinitionRecord Acquire(ContentFieldDefinition contentFieldDefinition) {
     var result = _fieldDefinitionRepository.Table.SingleOrDefault(x => x.Name == contentFieldDefinition.Name);
     if (result == null) {
         result = new ContentFieldDefinitionRecord { Name = contentFieldDefinition.Name };
         _fieldDefinitionRepository.Create(result);
     }
     return result;
 }
Exemplo n.º 5
0
        private ContentFieldDefinitionRecord Acquire(ContentFieldDefinition contentFieldDefinition)
        {
            var result = _contentStorageManager
                .Query<ContentFieldDefinitionRecord>(x => x.Name == contentFieldDefinition.Name)
                .SingleOrDefault();

            if (result == null) {
                result = new ContentFieldDefinitionRecord { Name = contentFieldDefinition.Name };
                _contentStorageManager.Store(result);
            }
            return result;
        }
Exemplo n.º 6
0
 private ContentFieldDefinitionRecord FetchFieldDefinition(string fieldType) {
     var baseFieldDefinition = _fieldDefinitionRepository.Get(def => def.Name == fieldType);
     if (baseFieldDefinition == null) {
         baseFieldDefinition = new ContentFieldDefinitionRecord {Name = fieldType};
         _fieldDefinitionRepository.Create(baseFieldDefinition);
     }
     return baseFieldDefinition;
 }