Skip to content

Commit

Permalink
RefitRestServiceAttribute renamed to BaseAddressAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri-voloshyn committed May 15, 2019
1 parent cd8975a commit c5ef508
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Refit.Tests/RestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public interface ITrimTrailingForwardSlashApi
Task Get();
}

[RefitRestService("/api/Test")]
[BaseAddress("/api/Test")]
public interface IRelativePathApi1
{
HttpClient Client { get; }
Expand All @@ -148,7 +148,7 @@ public interface IRelativePathApi1
Task Get();
}

[RefitRestService()]
[BaseAddress()]
public interface IRelativePathApi2
{
HttpClient Client { get; }
Expand Down
4 changes: 2 additions & 2 deletions Refit/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ public QueryAttribute(CollectionFormat collectionFormat)
}

[AttributeUsage(AttributeTargets.Interface)]
public class RefitRestServiceAttribute : Attribute
public class BaseAddressAttribute : Attribute
{
public RefitRestServiceAttribute(string relativePath = null)
public BaseAddressAttribute(string relativePath = null)
{
RelativePath = relativePath;
}
Expand Down
2 changes: 1 addition & 1 deletion Refit/RestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static object For(Type refitInterfaceType, HttpClient client, IRequestBui
{
var generatedType = TypeMapping.GetOrAdd(refitInterfaceType, type => GetGeneratedType(type));

var aps = refitInterfaceType.GetTypeInfo().GetCustomAttributes(true).OfType<RefitRestServiceAttribute>().FirstOrDefault();
var aps = refitInterfaceType.GetTypeInfo().GetCustomAttributes(true).OfType<BaseAddressAttribute>().FirstOrDefault();

if (aps != null && !string.IsNullOrEmpty(aps.RelativePath))
{
Expand Down

0 comments on commit c5ef508

Please sign in to comment.