コード例 #1
0
ファイル: WitsmlDataAdapter.cs プロジェクト: pyerbiz/witsml
 /// <summary>
 /// Retrieves data objects from the data store using the specified parser.
 /// </summary>
 /// <param name="parser">The query template parser.</param>
 /// <param name="context">The response context.</param>
 /// <returns>
 /// A collection of data objects retrieved from the data store.
 /// </returns>
 public virtual List <T> Query(WitsmlQueryParser parser, ResponseContext context)
 {
     throw new NotImplementedException();
 }
コード例 #2
0
ファイル: WitsmlDataAdapter.cs プロジェクト: pyerbiz/witsml
 /// <summary>
 /// Gets a list of the element names to ignore during an update.
 /// </summary>
 /// <param name="parser">The WITSML parser.</param>
 /// <returns>A list of element names.</returns>
 protected virtual List <string> GetIgnoredElementNamesForUpdate(WitsmlQueryParser parser)
 {
     return(null);
 }
コード例 #3
0
ファイル: WitsmlDataAdapter.cs プロジェクト: pyerbiz/witsml
 /// <summary>
 /// Gets a value indicating whether validation is enabled for this data adapter.
 /// </summary>
 /// <param name="function">The WITSML API method.</param>
 /// <param name="parser">The input template parser.</param>
 /// <param name="dataObject">The data object.</param>
 /// <returns><c>true</c> if validation is enabled for this data adapter; otherwise, <c>false</c>.</returns>
 public virtual bool IsValidationEnabled(Functions function, WitsmlQueryParser parser, T dataObject) => true;
コード例 #4
0
 /// <summary>
 /// Adds a data object to the data store.
 /// </summary>
 /// <param name="parser">The input template parser.</param>
 /// <param name="dataObject">The data object to be added.</param>
 public override void Add(WitsmlQueryParser parser, T dataObject)
 {
     InsertEntity(dataObject);
 }
コード例 #5
0
ファイル: WitsmlDataAdapter.cs プロジェクト: pyerbiz/witsml
 /// <summary>
 /// Gets a list of the property names to project during a query.
 /// </summary>
 /// <param name="parser">The WITSML parser.</param>
 /// <returns>A list of property names.</returns>
 protected virtual List <string> GetProjectionPropertyNames(WitsmlQueryParser parser)
 {
     return(null);
 }
コード例 #6
0
 /// <summary>
 /// Retrieves data objects from the data store using the specified parser.
 /// </summary>
 /// <param name="parser">The query template parser.</param>
 /// <param name="context">The response context.</param>
 /// <returns>
 /// A collection of data objects retrieved from the data store.
 /// </returns>
 public override List <T> Query(WitsmlQueryParser parser, ResponseContext context)
 {
     return(QueryEntities(parser));
 }
コード例 #7
0
 /// <summary>
 /// Merges the entity.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="parser">The WITSML query parser.</param>
 /// <param name="mergeDelete">Indicate if it is partial delete.</param>
 protected void MergeEntity(T entity, WitsmlQueryParser parser, bool mergeDelete = false)
 {
     MergeEntity(DbCollectionName, entity, parser, mergeDelete);
 }
コード例 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MongoDbMerge{T}" /> class.
 /// </summary>
 /// <param name="container">The composition container.</param>
 /// <param name="collection">The collection.</param>
 /// <param name="parser">The parser.</param>
 /// <param name="idPropertyName">Name of the identifier property.</param>
 /// <param name="ignored">The ignored.</param>
 public MongoDbMerge(IContainer container, IMongoCollection <T> collection, WitsmlQueryParser parser, string idPropertyName = "Uid", List <string> ignored = null) :
     base(container, collection, parser, idPropertyName, ignored)
 {
 }
コード例 #9
0
        /// <summary>
        /// Validates the input template for the specified function.
        /// </summary>
        /// <param name="function">The WITSML API method.</param>
        /// <param name="parser">The input template parser.</param>
        /// <param name="dataObject">The data object.</param>
        protected virtual void Validate(Functions function, WitsmlQueryParser parser, TObject dataObject)
        {
            var validator = Container.Resolve <IDataObjectValidator <TObject> >();

            validator.Validate(function, parser, dataObject);
        }
コード例 #10
0
 /// <summary>
 /// Queries the data store using the specified <see cref="WitsmlQueryParser"/>.
 /// </summary>
 /// <param name="parser">The query parser.</param>
 /// <returns>The query results collection.</returns>
 protected virtual List <T> QueryEntities(WitsmlQueryParser parser)
 {
     return(QueryEntities(parser, ObjectName.Name));
 }
コード例 #11
0
 /// <summary>
 /// Gets a value indicating whether validation is enabled for this data adapter.
 /// </summary>
 /// <param name="function">The WITSML API method.</param>
 /// <param name="parser">The input template parser.</param>
 /// <param name="dataObject">The data object.</param>
 /// <returns><c>true</c> if validation is enabled for this data adapter; otherwise, <c>false</c>.</returns>
 public override bool IsValidationEnabled(Functions function, WitsmlQueryParser parser, T dataObject)
 {
     return(MessageHandler.IsValidationEnabled(function, parser, dataObject));
 }
コード例 #12
0
 /// <summary>
 /// Gets a collection of data objects based on the specified query template parser.
 /// </summary>
 /// <param name="parser">The query template parser.</param>
 /// <returns>A collection of data objects retrieved from the data store.</returns>
 protected virtual List <T> GetAll(WitsmlQueryParser parser)
 {
     return(MessageHandler.IsQueryEnabled
         ? TypedMessageHandler.GetAll(parser)
         : new List <T>());
 }
コード例 #13
0
 /// <summary>
 /// Replaces a data object in the data store.
 /// </summary>
 /// <param name="parser">The input template parser.</param>
 /// <param name="dataObject">The data object to be replaced.</param>
 public override void Replace(WitsmlQueryParser parser, T dataObject)
 {
     ReplaceEntity(dataObject);
     //ValidateUpdatedEntity(Functions.PutObject, GetUri(dataObject));
 }
コード例 #14
0
 /// <summary>
 /// Updates a data object in the data store.
 /// </summary>
 /// <param name="parser">The input template parser.</param>
 /// <param name="dataObject">The data object to be updated.</param>
 public override void Update(WitsmlQueryParser parser, T dataObject)
 {
     UpdateEntity(dataObject);
     //ValidateUpdatedEntity(Functions.UpdateInStore, GetUri(dataObject));
 }
コード例 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MongoDbUpdate{T}" /> class.
 /// </summary>
 /// <param name="container">The composition container.</param>
 /// <param name="collection">The collection.</param>
 /// <param name="parser">The parser.</param>
 /// <param name="idPropertyName">Name of the identifier property.</param>
 /// <param name="ignored">The ignored.</param>
 public MongoDbUpdate(IContainer container, IMongoCollection <T> collection, WitsmlQueryParser parser, string idPropertyName = "Uid", List <string> ignored = null)
     : base(container, collection, parser, idPropertyName, ignored)
 {
     Logger.Verbose("Instance created.");
 }
コード例 #16
0
 /// <summary>
 /// Gets a collection of data objects based on the specified query template parser.
 /// </summary>
 /// <param name="parser">The query template parser.</param>
 /// <returns>A collection of data objects retrieved from the data store.</returns>
 public virtual List <T> GetAll(WitsmlQueryParser parser)
 {
     return(new List <T>());
 }
コード例 #17
0
 /// <summary>
 /// Sets the default values for the specified data object during update.
 /// </summary>
 /// <param name="dataObject">The data object.</param>
 /// <param name="parser">The element.</param>
 protected virtual void UpdateDefaultValues(TObject dataObject, WitsmlQueryParser parser)
 {
 }
コード例 #18
0
ファイル: WitsmlDataAdapter.cs プロジェクト: pyerbiz/witsml
 /// <summary>
 /// Replacs a data object in the data store.
 /// </summary>
 /// <param name="parser">The input template parser.</param>
 /// <param name="dataObject">The data object to be replaced.</param>
 public virtual void Replace(WitsmlQueryParser parser, T dataObject)
 {
     throw new NotImplementedException();
 }
コード例 #19
0
 /// <summary>
 /// Updates an object in the data store.
 /// </summary>
 /// <param name="parser">The WITSML query parser.</param>
 /// <param name="uri">The data object URI.</param>
 protected void UpdateEntity(WitsmlQueryParser parser, EtpUri uri)
 {
     UpdateEntity <T>(DbCollectionName, parser, uri);
 }
コード例 #20
0
ファイル: WitsmlDataAdapter.cs プロジェクト: pyerbiz/witsml
 /// <summary>
 /// Deletes or partially updates the specified object in the data store.
 /// </summary>
 /// <param name="parser">The input template parser.</param>
 public virtual void Delete(WitsmlQueryParser parser)
 {
     throw new NotImplementedException();
 }
コード例 #21
0
 /// <summary>
 /// Partials the delete entity.
 /// </summary>
 /// <param name="parser">The parser.</param>
 /// <param name="uri">The URI.</param>
 protected void PartialDeleteEntity(WitsmlQueryParser parser, EtpUri uri)
 {
     PartialDeleteEntity <T>(DbCollectionName, parser, uri);
 }
コード例 #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataObjectMapper{T}" /> class.
 /// </summary>
 /// <param name="container">The composition container.</param>
 /// <param name="parser">The query parser.</param>
 /// <param name="fields">The fields of the data object to be selected.</param>
 /// <param name="ignored">The fields of the data object to be ignored.</param>
 public DataObjectMapper(IContainer container, WitsmlQueryParser parser, List <string> fields, List <string> ignored = null) : base(container, new DataObjectMappingContext <T>())
 {
     Context.Ignored = ignored;
     _parser         = parser;
     _fields         = fields;
 }