示例#1
0
        /// <summary>
        /// Formats the WITSML query.
        /// </summary>
        /// <param name="query">The query.</param>
        /// <param name="optionsIn">The options in.</param>
        protected override IWitsmlQuery FormatWitsmlQuery(IWitsmlQuery query, params OptionsIn[] optionsIn)
        {
            if (!optionsIn.Contains(OptionsIn.ReturnElements.IdOnly))
            {
                return(base.FormatWitsmlQuery(query, optionsIn));
            }

            return(query
                   .With(OptionsIn.ReturnElements.Requested)
                   .Include(IncludeWitsmlQueryElements));
        }
示例#2
0
 /// <summary>
 /// Gets the <see cref="IWitsmlQuery{T}"/> instances by name.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="query">The query.</param>
 /// <param name="nameWell">The name well.</param>
 /// <param name="name">The name.</param>
 /// <returns>A data object of the specified type</returns>
 public static T GetByName <T>(this IWitsmlQuery <T> query, string nameWell, string name) where T : IWellObject
 {
     return(query.Where(x => x.NameWell == nameWell && x.Name == name).FirstOrDefault());
 }
示例#3
0
 /// <summary>
 /// Gets the <see cref="IWitsmlQuery{T}"/> instances by uid.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="query">The query.</param>
 /// <param name="uidWell">The uid well.</param>
 /// <param name="uidWellbore">The uid wellbore.</param>
 /// <param name="uid">The uid.</param>
 /// <returns>A data object of the specified type</returns>
 public static T GetByUid <T>(this IWitsmlQuery <T> query, string uidWell, string uidWellbore, string uid) where T : IWellboreObject
 {
     return(query.Where(x => x.UidWell == uidWell && x.UidWellbore == uidWellbore && x.Uid == uid).FirstOrDefault());
 }
示例#4
0
 /// <summary>
 /// Gets the <see cref="IWitsmlQuery{T}"/> instances by uid.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="query">The query.</param>
 /// <param name="uid">The uid.</param>
 /// <returns>A data object of the specified type</returns>
 public static T GetByUid <T>(this IWitsmlQuery <T> query, string uid) where T : IDataObject
 {
     return(query.Where(x => x.Uid == uid).FirstOrDefault());
 }
示例#5
0
 /// <summary>
 /// Formats the WITSML query.
 /// </summary>
 /// <param name="query">The query.</param>
 /// <param name="optionsIn">The options in.</param>
 protected virtual IWitsmlQuery FormatWitsmlQuery(IWitsmlQuery query, params OptionsIn[] optionsIn)
 {
     optionsIn.ForEach(x => query.With(x));
     return(query);
 }