C# 클래스 Kooboo.Commerce.Search.ModelConverter

Converts poco model to lucene document, or converts lucene document to poco model.
A poco model is converted to document with these rules: 1. For simple property (e.g., Int32, String, Decimal) - Create a normal lucene field (or numeric field) 2. For list/set/array property - Create a multi-valued field 3. For dictionary property - Create a field for each key, and the field name format is PropertyName[DictionaryKey] - The dictionary value can be a simple type or a list/set, if it's a list/set, a multi-valued field is created for each key
파일 보기 프로젝트 열기: Kooboo/Ecommerce 1 사용 예제들

공개 메소드들

메소드 설명
GetDictionaryFieldName ( string propertyName, string dictionaryKey ) : string
ParseFieldValue ( Type modelType, string field, string fieldValue ) : object
ToDocument ( object model ) : Lucene.Net.Documents.Document
ToModel ( Lucene.Net.Documents.Document document, Type modelType ) : object
TryParseDictionaryFieldName ( string fieldName, string &propertyName, string &dictionaryKey ) : bool

비공개 메소드들

메소드 설명
GetAddMethod ( Type collectionType, Type elementType ) : MethodInfo
ToFields ( object container, PropertyInfo property ) : IEnumerable

메소드 상세

GetDictionaryFieldName() 공개 정적인 메소드

public static GetDictionaryFieldName ( string propertyName, string dictionaryKey ) : string
propertyName string
dictionaryKey string
리턴 string

ParseFieldValue() 공개 정적인 메소드

public static ParseFieldValue ( Type modelType, string field, string fieldValue ) : object
modelType System.Type
field string
fieldValue string
리턴 object

ToDocument() 공개 정적인 메소드

public static ToDocument ( object model ) : Lucene.Net.Documents.Document
model object
리턴 Lucene.Net.Documents.Document

ToModel() 공개 정적인 메소드

public static ToModel ( Lucene.Net.Documents.Document document, Type modelType ) : object
document Lucene.Net.Documents.Document
modelType System.Type
리턴 object

TryParseDictionaryFieldName() 공개 정적인 메소드

public static TryParseDictionaryFieldName ( string fieldName, string &propertyName, string &dictionaryKey ) : bool
fieldName string
propertyName string
dictionaryKey string
리턴 bool