Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Using Cosmos DB as the dependency type name
Browse files Browse the repository at this point in the history
  • Loading branch information
Elfocrash committed Dec 11, 2018
1 parent a99270e commit 7b6a2fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Cosmonaut/Cosmonaut.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<RepositoryUrl>https://github.com/Elfocrash/Cosmonaut</RepositoryUrl>
<PackageTags>azure entitystore entity db orm microsoft cosmos cosmosdb documentdb docdb nosql azureofficial dotnetcore netcore netstandard</PackageTags>
<PackageReleaseNotes>Please report any issues on Github.</PackageReleaseNotes>
<Version>2.7.0</Version>
<Version>2.7.1</Version>
<NeutralLanguage></NeutralLanguage>
<Company>Nick Chapsas</Company>
<PackageIconUrl>https://raw.githubusercontent.com/Elfocrash/Cosmonaut/develop/logo.png</PackageIconUrl>
Expand Down
18 changes: 2 additions & 16 deletions src/Cosmonaut/Diagnostics/CosmosEventExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,7 @@ public static CosmosEventMetadata AsDependency(this IDictionary<string, object>
{
return CosmosEventDataConverter.ConvertToDependencyFromEventData(eventData);
}

internal static string GetAgentName(this object invoker)
{
var type = invoker.GetType();

if (!type.IsConstructedGenericType)
{
return type.Name;
}

var i = type.Name.IndexOf('`');

return i <= -1 ? type.Name.Substring(0, i) : type.Name;
}


internal static CosmosEventCall CreateCosmosEventCall(
this object agent,
string data,
Expand All @@ -98,7 +84,7 @@ internal static string GetAgentName(this object invoker)
{
var dependencyData = new CosmosEventMetadata()
{
DependencyTypeName = GetAgentName(agent),
DependencyTypeName = "Cosmos DB",
Target = target,
DependencyName = name,
Data = data,
Expand Down

0 comments on commit 7b6a2fb

Please sign in to comment.