Skip to content

Commit

Permalink
Fixing build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jregnier committed Nov 26, 2020
1 parent decfc10 commit 29eebf7
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 44 deletions.
7 changes: 7 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*.cs]

# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = none

# S1075: URIs should not be hardcoded
dotnet_diagnostic.S1075.severity = none
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// <summary>
/// Object used to test the abstract <see cref="ServiceBase{TService, TModel}"/> class.
/// </summary>
public class ServiceBaseObjectService : ServiceBase<CardService, Card>
public class ServiceBaseObjectService : ServiceBase<Card>
{
/// <summary>
/// Initializes a new instance of the <see cref="ServiceBaseObjectService"/> class. Defaults to version 1.0 of the API.
Expand Down
1 change: 1 addition & 0 deletions src/MtgApiManager.Lib/MtgApiManager.Lib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>

</Project>
41 changes: 19 additions & 22 deletions src/MtgApiManager.Lib/MtgApiManager.Lib.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/MtgApiManager.Lib/Service/CardService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace MtgApiManager.Lib.Service
/// Object representing a MTG card.
/// </summary>
public class CardService
: ServiceBase<CardService, Card>, IMtgQueryable<CardService, CardQueryParameter>
: ServiceBase<Card>, IMtgQueryable<CardService, CardQueryParameter>
{
/// <summary>
/// Initializes a new instance of the <see cref="CardService"/> class. Defaults to version 1.0 of the API.
Expand All @@ -28,6 +28,7 @@ public CardService()
/// Initializes a new instance of the <see cref="CardService"/> class.
/// </summary>
/// <param name="serviceAdapter">The service adapter used to interact with the MTG API.</param>
/// <param name="modelMapper">Used to map entity objects to models.</param>
/// <param name="version">The version of the API</param>
/// <param name="rateLimitOn">Turn the rate limit on or off.</param>
public CardService(
Expand All @@ -40,9 +41,9 @@ public CardService(
}

/// <summary>
/// Gets all the <see cref="TModel"/> defined by the query parameters.
/// Gets all the <see cref="Card"/> defined by the query parameters.
/// </summary>
/// <returns>A <see cref="Exceptional{List{Card}}"/> representing the result containing all the items.</returns>
/// <returns>A <see cref="Exceptional{T}"/> representing the result containing all the items.</returns>
public async override Task<Exceptional<List<Card>>> AllAsync()
{
try
Expand Down
18 changes: 7 additions & 11 deletions src/MtgApiManager.Lib/Service/ServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,19 @@ namespace MtgApiManager.Lib.Service
/// <summary>
/// Base class for a service.
/// </summary>
/// <typeparam name="TService">The type of service.</typeparam>
/// <typeparam name="TModel">The type of model used by the service.</typeparam>
public abstract class ServiceBase<TService, TModel>
where TService : class
public abstract class ServiceBase<TModel>
where TModel : class
{
/// <summary>
/// The base URL to the MTG API.
/// </summary>
protected const string BaseMtgUrl = "https://api.magicthegathering.io";
private const string BASE_URL = "https://api.magicthegathering.io";

private readonly bool _isRateLimitOn;

/// <summary>
/// Initializes a new instance of the <see cref="ServiceBase{TService, TModel}"/> class.
/// Initializes a new instance of the <see cref="ServiceBase{TModel}"/> class.
/// </summary>
/// <param name="serviceAdapter">The service adapter used to interact with the MTG API.</param>
/// <param name="modelMapper">Used to map entity objects to models.</param>
/// <param name="version">The version of the API (currently only 1 version.)</param>
/// <param name="endpoint">The end point of the service.</param>
/// <param name="rateLimitOn">Turn the rate limit on or off.</param>
Expand All @@ -47,7 +43,7 @@ protected ServiceBase(
}

protected IMtgApiServiceAdapter Adapter { get; }

protected string BaseMtgUrl => BASE_URL;
protected ApiEndPoint EndPoint { get; }

protected IModelMapper ModelMapper { get; }
Expand All @@ -60,9 +56,9 @@ protected ServiceBase(
protected Dictionary<string, string> WhereQueries { get; }

/// <summary>
/// Gets all the <see cref="TModel"/> defined by the query parameters.
/// Gets all the objects defined by the query parameters.
/// </summary>
/// <returns>A <see cref="Exceptional{List{TModel}}"/> representing the result containing all the items.</returns>
/// <returns>A <see cref="Exceptional{T}"/> representing the result containing all the items.</returns>
public abstract Task<Exceptional<List<TModel>>> AllAsync();

/// <summary>
Expand Down
9 changes: 5 additions & 4 deletions src/MtgApiManager.Lib/Service/SetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace MtgApiManager.Lib.Service
/// Object representing a MTG set.
/// </summary>
public class SetService
: ServiceBase<SetService, Set>, IMtgQueryable<SetService, SetQueryParameter>
: ServiceBase<Set>, IMtgQueryable<SetService, SetQueryParameter>
{
/// <summary>
/// Initializes a new instance of the <see cref="SetService"/> class. Defaults to version 1.0 of the API.
Expand All @@ -30,6 +30,7 @@ public SetService()
/// Initializes a new instance of the <see cref="SetService"/> class.
/// </summary>
/// <param name="serviceAdapter">The service adapter used to interact with the MTG API.</param>
/// <param name="modelMapper">Used to map entity objects to models.</param>
/// <param name="version">The version of the API</param>
/// <param name="rateLimitOn">Turn the rate limit on or off.</param>
public SetService(
Expand All @@ -42,9 +43,9 @@ public SetService(
}

/// <summary>
/// Gets all the <see cref="TModel"/> defined by the query parameters.
/// Gets all the <see cref="Set"/> defined by the query parameters.
/// </summary>
/// <returns>A <see cref="Exceptional{List{Set}}"/> representing the result containing all the items.</returns>
/// <returns>A <see cref="Exceptional{T}"/> representing the result containing all the items.</returns>
public async override Task<Exceptional<List<Set>>> AllAsync()
{
try
Expand Down Expand Up @@ -83,7 +84,7 @@ public async Task<Exceptional<Set>> FindAsync(string code)
/// Generates a booster pack for a specific set asynchronously.
/// </summary>
/// <param name="code">The set code to generate a booster for.</param>
/// <returns>A <see cref="Exceptional{List{Card}}"/> representing the result containing a <see cref="List{Card}"/> or an exception.</returns>
/// <returns>A <see cref="Exceptional{T}"/> representing the result containing a <see cref="List{Card}"/> or an exception.</returns>
public async Task<Exceptional<List<Card>>> GenerateBoosterAsync(string code)
{
try
Expand Down
2 changes: 1 addition & 1 deletion src/MtgApiManager.Lib/Utility/QueryUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class QueryUtility
/// </summary>
/// <typeparam name="T">The type to look for the property in.</typeparam>
/// <param name="propertyName">The name of the property to get the query parameter for.</param>
/// <returns>A <see cref="string"/> representing the query name defined in the <see cref="JsonProperty"/></returns>
/// <returns>A <see cref="string"/> representing the query name defined in the JSON property</returns>
public static string GetQueryPropertyName<T>(string propertyName)
{
if (string.IsNullOrEmpty(propertyName))
Expand Down
9 changes: 7 additions & 2 deletions src/MtgApiManager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MtgApiManager.Lib.TestApp",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "..\build\_build.csproj", "{E59A8693-3B65-4309-A1DB-36F8A1658876}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{71717EE0-3EB9-4509-8EA5-156B3CB7673D}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E59A8693-3B65-4309-A1DB-36F8A1658876}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E59A8693-3B65-4309-A1DB-36F8A1658876}.Release|Any CPU.ActiveCfg = Release|Any CPU
{363A4B72-00F1-494C-9A0B-7BAFAC907C75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{363A4B72-00F1-494C-9A0B-7BAFAC907C75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{363A4B72-00F1-494C-9A0B-7BAFAC907C75}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -31,6 +34,8 @@ Global
{6C5F645B-CB4E-4460-9862-94CCFE52CF64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C5F645B-CB4E-4460-9862-94CCFE52CF64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C5F645B-CB4E-4460-9862-94CCFE52CF64}.Release|Any CPU.Build.0 = Release|Any CPU
{E59A8693-3B65-4309-A1DB-36F8A1658876}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E59A8693-3B65-4309-A1DB-36F8A1658876}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 29eebf7

Please sign in to comment.