How to use MembersDiscoveryRequest class of NBi.Core.Analysis.Request package

Best NBi code snippet using NBi.Core.Analysis.Request.MembersDiscoveryRequest

AbstractMembersCollectionConstraint.cs

Source:AbstractMembersCollectionConstraint.cs Github

copy

Full Screen

...15 public abstract class AbstractMembersCollectionConstraint : AbstractMembersConstraint16 {1718 private readonly IDbCommand commandToRetrieveExpectedItems;19 private readonly MembersDiscoveryRequest membersDiscoveryRequest;20 private IEnumerable<string> expectedItems;2122 protected IEnumerable<string> ExpectedItems23 {24 get25 {26 return expectedItems;27 }28 }29 3031 /// <summary>32 /// Construct a AbstractMembersConstraint33 /// </summary>34 /// <param name="expected">The command to retrieve the list of expected items</param>35 public AbstractMembersCollectionConstraint(IDbCommand expected)36 : base()37 {38 commandToRetrieveExpectedItems = expected;39 }4041 /// <summary>42 /// Construct a AbstractMembersConstraint43 /// </summary>44 /// <param name="expected">The list of expected items</param>45 public AbstractMembersCollectionConstraint(IEnumerable<string> expected)46 : base()47 {48 expectedItems = expected;49 }5051 /// <summary>52 /// Construct a AbstractMembersConstraint53 /// </summary>54 /// <param name="expected">The request to discover members in a hierarchy or level</param>55 public AbstractMembersCollectionConstraint(MembersDiscoveryRequest expected)56 : base()57 {58 membersDiscoveryRequest = expected;59 }6061 62 #region Specific NUnit6364 protected override void PreInitializeMatching()65 {66 if (commandToRetrieveExpectedItems != null)67 expectedItems = GetMembersFromResultSet(commandToRetrieveExpectedItems);68 if (membersDiscoveryRequest != null)69 expectedItems = GetMembersFromDiscoveryRequest(membersDiscoveryRequest);70 }717273 protected IEnumerable<string> GetMembersFromResultSet(Object obj)74 {75 var rs = ResultSetBuilder.Build(obj);7677 var members = new List<string>();78 foreach (DataRow row in rs.Rows)79 members.Add(row.ItemArray[0].ToString());8081 return members;82 }8384 protected IEnumerable<string> GetMembersFromDiscoveryRequest(MembersDiscoveryRequest disco)85 {86 var engine = new MembersAdomdEngine();87 var results = engine.GetMembers(disco);8889 var members = results.ToCaptions();90 return members;91 }9293 /// <summary>94 /// Engine dedicated to ResultSet acquisition95 /// </summary>96 protected IResultSetBuilder resultSetBuilder;97 protected internal IResultSetBuilder ResultSetBuilder98 { ...

Full Screen

Full Screen

AbstractMembersConstraint.cs

Source:AbstractMembersConstraint.cs Github

copy

Full Screen

...17 18 /// <summary>19 /// Request for metadata extraction20 /// </summary>21 public MembersDiscoveryRequest Request { get; protected set; }2223 /// <summary>24 /// Engine dedicated to Members acquisition25 /// </summary>26 protected internal MembersAdomdEngine MembersEngine27 {28 get29 {30 if (membersEngine == null)31 membersEngine = new MembersAdomdEngine();32 return membersEngine;33 }34 set35 {36 if (value == null)37 throw new ArgumentNullException();38 membersEngine = value;39 }40 }4142 /// <summary>43 /// Construct a AbstractMembersConstraint44 /// </summary>45 /// <param name="expected"></param>46 public AbstractMembersConstraint()47 {48 Comparer = new NBi.Core.Analysis.Member.Member.ComparerByCaption(true);49 }5051 #region Modifiers52 /// <summary>53 /// Flag the constraint to ignore case and return self.54 /// </summary>55 protected void IgnoreCase()56 {57 Comparer = new NBi.Core.Analysis.Member.Member.ComparerByCaption(false);58 }5960 #endregion61 62 #region Specific NUnit63 public override bool Matches(object actual)64 {65 if (!isInitialized)66 InitializeMatching();67 68 if (actual is MembersDiscoveryRequest)69 return Process((MembersDiscoveryRequest)actual);70 else if (actual is MemberResult)71 {72 this.actual = actual;73 var ctr = internalConstraint;74 if (ctr is NUnitCtr.CollectionItemsEqualConstraint)75 ctr = ((NUnitCtr.CollectionItemsEqualConstraint)ctr).Using(Comparer);76 var res = DoMatch(ctr);77 return res;78 }79 else80 throw new ArgumentException();81 }8283 protected virtual bool DoMatch(NUnitCtr.Constraint ctr)84 {85 return ctr.Matches(actual);86 }878889 private void InitializeMatching()90 {91 PreInitializeMatching();92 internalConstraint = BuildInternalConstraint();93 isInitialized = true;94 }9596 protected virtual void PreInitializeMatching()97 {98 99 }100101 protected abstract NUnitCtr.Constraint BuildInternalConstraint();102103 protected bool Process(MembersDiscoveryRequest actual)104 {105 Request = actual;106 var engine = MembersEngine;107 MemberResult result = engine.GetMembers(Request);108 return this.Matches(result);109 }110111 #endregion112113 }114} ...

Full Screen

Full Screen

MembersDiscoveryRequest

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Analysis.Request;2using NBi.Core.Analysis.Member;3using NBi.Core.Analysis.Metadata;4using System;5using System.Collections.Generic;6using System.Linq;7using System.Text;8using System.Threading.Tasks;9using System.Data;10{11 {12 public string Caption { get; set; }13 public string HierarchyUniqueName { get; set; }14 public string LevelUniqueName { get; set; }15 public string MemberUniqueName { get; set; }16 public string MemberName { get; set; }17 public MemberType MemberType { get; set; }18 public string MemberUniqueNameParent { get; set; }19 public string MemberNameParent { get; set; }20 public string HierarchyUniqueNameParent { get; set; }21 public string LevelUniqueNameParent { get; set; }22 public MemberType MemberTypeParent { get; set; }23 public string CaptionParent { get; set; }24 public string HierarchyUniqueNameParentParent { get; set; }25 public string LevelUniqueNameParentParent { get; set; }26 public string MemberUniqueNameParentParent { get; set; }27 public string MemberNameParentParent { get; set; }28 public MemberType MemberTypeParentParent { get; set; }29 public string CaptionParentParent { get; set; }30 public string HierarchyUniqueNameParentParentParent { get; set; }31 public string LevelUniqueNameParentParentParent { get; set; }32 public string MemberUniqueNameParentParentParent { get; set; }33 public string MemberNameParentParentParent { get; set; }34 public MemberType MemberTypeParentParentParent { get; set; }35 public string CaptionParentParentParent { get; set; }36 public string HierarchyUniqueNameParentParentParentParent { get; set; }37 public string LevelUniqueNameParentParentParentParent { get; set; }38 public string MemberUniqueNameParentParentParentParent { get; set; }39 public string MemberNameParentParentParentParent { get; set; }40 public MemberType MemberTypeParentParentParentParent { get; set; }41 public string CaptionParentParentParentParent { get; set; }42 public string HierarchyUniqueNameParentParentParentParentParent { get; set; }

Full Screen

Full Screen

MembersDiscoveryRequest

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Analysis.Request;2using NBi.Core.Analysis.Member;3using System;4using System.Collections.Generic;5using System.Linq;6using System.Text;7using System.Threading.Tasks;8using System.Data;9using NBi.Core;10using NBi.Core.Analysis.Metadata;11using NBi.Core.Analysis.Metadata.Adomd;12using NBi.Core.Analysis.Member.Adomd;13using NBi.Core.Analysis.Request.Adomd;14using NBi.Core.Analysis.Member;15using NBi.Core.Analysis.Request;16using NBi.Core.Analysis.Metadata;17using NBi.Core.Analysis.Request.Adomd;18using System.Data;19using System.Data.OleDb;20using System.Data.Common;21using System.Data.SqlClient;22using System.Data.Odbc;23using System.Data.OracleClient;24using System.Data.OleDb;25using System.Data.Sql;26using System.Data.SqlTypes;27using System.Data.SqlServerCe;28using System.Data.Common;29using System.Data;30using System.Data.Odbc;31using System.Data.OleDb;32using System.Data.OracleClient;33using System.Data.SqlClient;34using System.Data.SqlServerCe;35using System.Data.SqlTypes;36using System.Data.Sql;37using System.Data.Common;38using System.Data;39using System.Data.Odbc;40using System.Data.OleDb;41using System.Data.OracleClient;42using System.Data.SqlClient;43using System.Data.SqlServerCe;44using System.Data.SqlTypes;45using System.Data.Sql;46using System.Data.Common;47using System.Data;48using System.Data.Odbc;49using System.Data.OleDb;50using System.Data.OracleClient;51using System.Data.SqlClient;52using System.Data.SqlServerCe;53using System.Data.SqlTypes;54using System.Data.Sql;55using System.Data.Common;56using System.Data;57using System.Data.Odbc;58using System.Data.OleDb;59using System.Data.OracleClient;60using System.Data.SqlClient;61using System.Data.SqlServerCe;62using System.Data.SqlTypes;63using System.Data.Sql;64using System.Data.Common;65using System.Data;66using System.Data.Odbc;67using System.Data.OleDb;68using System.Data.OracleClient;69using System.Data.SqlClient;70using System.Data.SqlServerCe;71using System.Data.SqlTypes;72using System.Data.Sql;73using System.Data.Common;74using System.Data;75using System.Data.Odbc;76using System.Data.OleDb;77using System.Data.OracleClient;78using System.Data.SqlClient;79using System.Data.SqlServerCe;80using System.Data.SqlTypes;81using System.Data.Sql;82using System.Data.Common;83using System.Data;

Full Screen

Full Screen

MembersDiscoveryRequest

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Analysis.Request;2var request = new MembersDiscoveryRequest();3request.Cube = "Adventure Works";4request.Dimension = "[Date]";5request.Hierarchy = "[Date].[Fiscal]";6request.Level = "[Date].[Fiscal].[Fiscal Year]";7request.Member = "[Date].[Fiscal].[Fiscal Year].&[2002]";8using NBi.Core.Analysis.Request;9var request = DiscoveryRequestFactory.CreateMembersRequest(10 "Adventure Works", "[Date]", "[Date].[Fiscal]", "[Date].[Fiscal].[Fiscal Year]", "[Date].[Fiscal].[Fiscal Year].&[2002]");11using NBi.Core.Analysis.Request;12var request = new MembersDiscoveryRequest();13request.Cube = "Adventure Works";14request.Dimension = "[Date]";15request.Hierarchy = "[Date].[Fiscal]";16request.Level = "[Date].[Fiscal].[Fiscal Year]";17request.Member = "[Date].[Fiscal].[Fiscal Year].&[2002]";18request.MemberCaption = "2002";19using NBi.Core.Analysis.Request;20var request = DiscoveryRequestFactory.CreateMembersRequest(21 "Adventure Works", "[Date]", "[Date].[Fiscal]", "[Date].[Fiscal].[Fiscal Year]", "[Date].[Fiscal].[Fiscal Year].&[2002]", "2002");22using NBi.Core.Analysis.Request;23var request = new MembersDiscoveryRequest();24request.Cube = "Adventure Works";25request.Dimension = "[Date]";26request.Hierarchy = "[Date].[Fiscal]";27request.Level = "[Date].[Fiscal].[Fiscal Year]";28request.MemberCaption = "2002";29using NBi.Core.Analysis.Request;30var request = DiscoveryRequestFactory.CreateMembersRequest(31 "Adventure Works", "[Date]", "[Date].[Fiscal]", "[Date].[Fiscal].[Fiscal Year]", null, "2002");

Full Screen

Full Screen

MembersDiscoveryRequest

Using AI Code Generation

copy

Full Screen

1using NBi.Core.Analysis.Request;2using NBi.Core.Analysis.Member;3using NBi.Core.Analysis.Metadata;4using NBi.Core.Analysis.Metadata.Adomd;5using NBi.Core.Analysis;6using System;7using System.Collections.Generic;8using System.Linq;9using System.Text;10using System.Threading.Tasks;11using System.Xml;12{13 {14 static void Main(string[] args)15 {16 string connectionString = "Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=Adventure Works DW 2008 R2;Data Source=ServerName";17 string cubeName = "Adventure Works";18 string dimensionName = "Date";19 string hierarchyName = "Date";20 string levelName = "Fiscal Year";21 string query = "SELECT NON EMPTY {[Measures].[Internet Sales Amount]} ON COLUMNS, NON EMPTY {([Date].[Fiscal Year].&[2003])} ON ROWS FROM [Adventure Works]";22 MembersDiscoveryRequest request = new MembersDiscoveryRequest();23 request.ConnectionString = connectionString;24 request.CubeName = cubeName;25 request.DimensionName = dimensionName;26 request.HierarchyName = hierarchyName;27 request.LevelName = levelName;28 request.Query = query;29 request.MemberType = MemberType.Leaf;30 request.MemberCaption = "2003";31 request.MemberUniqueName = "Date.Fiscal Year.2003";32 MetadataDiscoveryFactory factory = new MetadataDiscoveryFactory();33 var discovery = factory.Instantiate(request);34 var result = discovery.Execute();35 Console.WriteLine(result.Members.Count());36 Console.ReadKey();37 }38 }39}40NBi.Core.Analysis.Metadata.Adomd.AdomdMetadataDiscoveryException: 'An error occurred while discovering the members. The error message is: The server failed to process the request. The server failed to process the request. (Microsoft.AnalysisServices)'

Full Screen

Full Screen

MembersDiscoveryRequest

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using Microsoft.AnalysisServices;7using NBi.Core.Analysis.Request;8using NBi.Core.Analysis.Member;9{10 {11 static void Main(string[] args)12 {13 Server server = new Server();14 server.Connect("Provider=MSOLAP;Data Source=localhost;Initial Catalog=Adventureworks");15 Database db = server.Databases["Adventure Works"];16 Cube cube = db.Cubes["Adventure Works"];17 Dimension dim = cube.Dimensions["Customer"];18 MembersDiscoveryRequest request = new MembersDiscoveryRequest(dim);19 request.Hierarchy = "Customer";20 request.Level = "Customer Geography";21 request.Members = new List<string>() { "United States" };22 var members = request.Execute();23 foreach (var member in members)24 {25 Console.WriteLine(member.Caption);26 }27 Console.Read();28 }29 }30}

Full Screen

Full Screen

MembersDiscoveryRequest

Using AI Code Generation

copy

Full Screen

1{2 {3 public void MyTestMethod()4 {5 var connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True";6 var membersDiscoveryRequest = new MembersDiscoveryRequest(connectionString, "AdventureWorks2012", "DimProduct", "ProductKey");7 var membersDiscovery = new MembersDiscovery(membersDiscoveryRequest);8 var members = membersDiscovery.Execute();9 }10 }11}12{13 {14 public void MyTestMethod()15 {16 var connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True";17 var membersDiscoveryRequest = new MembersDiscoveryRequest(connectionString, "AdventureWorks2012", "DimProduct", "ProductKey");18 var membersDiscovery = new MembersDiscovery(membersDiscoveryRequest);19 var members = membersDiscovery.Execute();20 }21 }22}23{24 {25 public void MyTestMethod()26 {27 var connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True";28 var membersDiscoveryRequest = new MembersDiscoveryRequest(connectionString, "AdventureWorks2012", "DimProduct", "ProductKey");29 var membersDiscovery = new MembersDiscovery(membersDiscoveryRequest);30 var members = membersDiscovery.Execute();31 }32 }33}34{35 {36 public void MyTestMethod()37 {38 var connectionString = "Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True";39 var membersDiscoveryRequest = new MembersDiscoveryRequest(connectionString, "AdventureWorks2012", "DimProduct", "ProductKey");40 var membersDiscovery = new MembersDiscovery(membersDiscoveryRequest);41 var members = membersDiscovery.Execute();42 }43 }44}

Full Screen

Full Screen

MembersDiscoveryRequest

Using AI Code Generation

copy

Full Screen

1MembersDiscoveryRequest request = new MembersDiscoveryRequest();2request.Dimension = "Dimension1";3request.Hierarchy = "Hierarchy1";4request.Level = "Level1";5requests.Add(request);6DiscoveryCommand command = new DiscoveryCommand(connection, requests);7var result = command.Execute();

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run NBi automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used methods in MembersDiscoveryRequest

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful