Ejemplo n.º 1
0
 public string Field(Field field) => FieldResolver.Resolve(field);
			public void CachedVsNonCached()
			{
				_resolver = new FieldResolver(new ConnectionSettings());

				AddTiming(() => Field<Project>(p => p.Metadata["fixed"]));
				var x = "dynamic";
				AddTiming(() => Field<Project>(p => p.Metadata[x]));
				AddTiming(() => Field<Project>(p => p.Name));
				AddTiming(() => Field<Project>(p => p.Description));
				AddTiming(() => Field<Project>(p => p.NumberOfCommits));
				AddTiming(() => Field<Project>(p => p.LastActivity));
				AddTiming(() => Field<Project>(p => p.LeadDeveloper));
				AddTiming(() => Field<Project>(p => p.Metadata));
				AddTiming(() => Field<Project>(p => p.Tags));
				AddTiming(() => Field<Project>(p => p.CuratedTags));

				AddTiming(() => Field<CommitActivity>(p => p.Id));
				AddTiming(() => Field<CommitActivity>(p => p.Message));
				AddTiming(() => Field<CommitActivity>(p => p.ProjectName));
				AddTiming(() => Field<CommitActivity>(p => p.StringDuration));

				output.WriteLine(_timings.Aggregate(new StringBuilder().AppendLine(), (sb, s) => sb.AppendLine(s.ToString()), sb => sb.ToString()));
			}
Ejemplo n.º 3
0
 public string PropertyName(PropertyName property) => FieldResolver.Resolve(property);