/// <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)); }
/// <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()); }
/// <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()); }
/// <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()); }
/// <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); }