public QueryFactory( ITypeManager typeManager, IIdAccessor idAccessor) { _typeManager = typeManager; _idAccessor = idAccessor; }
public LoadPipeline(CouchDb couchDb, IIdManager idManager, IIdAccessor idAccessor, IRevisionAccessor revisionAccessor) { _couchDb = couchDb; _idManager = idManager; _idAccessor = idAccessor; _revisionAccessor = revisionAccessor; }
public Serializer(IIdAccessor idAccessor, IRevisionAccessor revisionAccessor) { var factory = new SerializerSettingsFactory(); factory.SetUpDocumentContractResolver(idAccessor, revisionAccessor); var settings = factory.Create(); _settings = settings; _jsonSerializer = JsonSerializer.Create(_settings); }
public QueryProvider(ITypeManager typeManager, IIdAccessor idAccessor, ISession session, IEnumerable <string> index = null) { _sessionContext = new SessionContext() { TypeManager = typeManager, IdAccessor = idAccessor }; _session = session; _index = index; }
/// <summary> /// create an instance of the contract resolver to handle Counch DB documents /// </summary> public DocumentContractResolver(IIdAccessor idAccessor, IRevisionAccessor revisionAccessor) : base() { _baseOverride = new BaseOverride(idAccessor, revisionAccessor); var naming = new LocalCamelCaseNamingStrategy { OverrideSpecifiedNames = true, ProcessDictionaryKeys = true }; NamingStrategy = naming; }
/// <summary> /// Set the Id directly against a Type /// </summary> /// <typeparam name="T">the tpye which to set the Id against</typeparam> /// <param name="idAccessor">the idaccessor instance</param> /// <param name="field">Id Field</param> public static void SetUpId <T>(this IIdAccessor idAccessor, FieldInfo field) { if (idAccessor == null) { throw new ArgumentNullException(nameof(idAccessor)); } if (field == null) { throw new ArgumentNullException(nameof(field)); } idAccessor.SetUpId(typeof(T), field); }
public StructureSchema(IStructureType type, IIdAccessor idAccessor = null, IConcurrencyTokenAccessor concurrencyTokenAccessor = null, ITimeStampAccessor timeStampAccessor = null, ICollection <IIndexAccessor> indexAccessors = null) { Ensure.That(type, "type").IsNotNull(); Type = type; IdAccessor = idAccessor; ConcurrencyTokenAccessor = concurrencyTokenAccessor; TimeStampAccessor = timeStampAccessor; IndexAccessors = indexAccessors != null ? new List <IIndexAccessor>(indexAccessors) : new List <IIndexAccessor>(); }
public StructureSchema(IStructureType type, IIdAccessor idAccessor = null, IConcurrencyTokenAccessor concurrencyTokenAccessor = null, ITimeStampAccessor timeStampAccessor = null, ICollection<IIndexAccessor> indexAccessors = null) { Ensure.That(type, "type").IsNotNull(); Type = type; IdAccessor = idAccessor; ConcurrencyTokenAccessor = concurrencyTokenAccessor; TimeStampAccessor = timeStampAccessor; IndexAccessors = indexAccessors != null ? new List<IIndexAccessor>(indexAccessors) : new List<IIndexAccessor>(); }
/* * public static void SetUpId<T>(FieldMeta field) * { * if (field == null) throw new ArgumentNullException(nameof(field)); * _typeIdFields.Add(typeof(T), field); * } */ /// <summary> /// Set the Id directly against a Type /// </summary> /// <typeparam name="T">the tpye which to set the Id against</typeparam> /// <param name="idAccessor">the idaccessor instance</param> /// <param name="fieldName">name of the Id field</param> public static void SetUpId <T>(this IIdAccessor idAccessor, string fieldName) { if (idAccessor == null) { throw new ArgumentNullException(nameof(idAccessor)); } if (fieldName == null) { throw new ArgumentNullException(nameof(fieldName)); } FieldMeta fieldInfo = typeof(T).GetTypeMeta().Fields.FirstOrDefault(x => x.Name == fieldName); SetUpId <T>(idAccessor, fieldInfo?.FieldInfo); }
/// <summary> /// Set the Id directly against a Type /// </summary> /// <typeparam name="T">the tpye which to set the Id against</typeparam> /// <param name="idAccessor">the id accessor instance</param> /// <param name="property">The Id property, this will then use the Auto back field</param> public static void SetUpId <T>(this IIdAccessor idAccessor, Expression <Func <T, object> > property) { if (idAccessor == null) { throw new ArgumentNullException(nameof(idAccessor)); } if (property == null) { throw new ArgumentNullException(nameof(property)); } string name = ((MemberExpression)property.Body).Member.Name; string backingFieldName = GetPropertyBackingFieldName(name); SetUpId <T>(idAccessor, backingFieldName); }
public StructureSchema(string name, IIdAccessor idAccessor, IEnumerable<IIndexAccessor> indexAccessors = null) { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException("name"); if(idAccessor == null) throw new ArgumentNullException("idAccessor"); Name = name; Hash = SisoDbEnvironment.HashService.GenerateHash(name); IdAccessor = idAccessor; IndexAccessors = indexAccessors != null ? new List<IIndexAccessor>(indexAccessors) : new List<IIndexAccessor>(); UniqueIndexAccessors = indexAccessors != null ? new List<IIndexAccessor>(indexAccessors.Where(iac => iac.IsUnique)) : new List<IIndexAccessor>(); }
public Session( LoadPipeline loadPipeline, QueryPipeline queryPipeline, CommitPipeline commitPipeline, QueryFactory queryFactory, IIdManager idManager, IIdAccessor idAccessor, ITrackingProvider tracking, ISessionCache sessionCache ) { _sessionCache = sessionCache; _loadPipeline = loadPipeline; _queryPipeline = queryPipeline; _commitPipeline = commitPipeline; _queryFactory = queryFactory; _idManager = idManager; _idAccessor = idAccessor; _tracking = tracking; }
public TransactionCoordinator(CouchDb couchDb, IIdAccessor idAccessor, IRevisionAccessor revisionAccessor) { _couchDb = couchDb; _idAccessor = idAccessor; _revisionAccessor = revisionAccessor; }
public LoadManyFromDatabaseAction(CouchDb couchDb, IIdManager idManager, IIdAccessor idAccessor) { _couchDb = couchDb; _idManager = idManager; _idAccessor = idAccessor; }
public void SetUpDocumentContractResolver(IIdAccessor idAccessor, IRevisionAccessor revisionAccessor) { ContractResolver = new DocumentContractResolver(idAccessor, revisionAccessor); }
/// <summary> /// create the base override, to support the Id and Revision /// </summary> /// <param name="idAccessor">the idaccessor use to find the Id</param> /// <param name="revisionAccessor">the revisionaccessor is used to find the revision</param> public BaseOverride(IIdAccessor idAccessor, IRevisionAccessor revisionAccessor) { _idAccessor = idAccessor; _revisionAccessor = revisionAccessor; }