Skip to content

Commit

Permalink
refactor(sln): resolve .net analyzer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
seangwright committed May 7, 2024
1 parent 92b1c79 commit 16f4b19
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public class SampleDataGeneratorApplication : OverviewPageBase
private readonly IFormBuilderConfigurationSerializer formBuilderConfigurationSerializer;
private readonly IEventLogService eventLogService;
private readonly IInfoProvider<ConsentInfo> consentInfoProvider;
private readonly IBizFormInfoProvider bizFormInfoProvider;
private readonly IContactGroupInfoProvider contactGroupInfoProvider;
private readonly IInfoProvider<BizFormInfo> bizFormInfoProvider;
private readonly IInfoProvider<ContactGroupInfo> contactGroupInfoProvider;
private readonly ISettingsKeyInfoProvider settingsKeyInfoProvider;
private readonly IInfoProvider<WebsiteChannelInfo> websiteChannelInfoProvider;

Expand All @@ -61,8 +61,8 @@ public SampleDataGeneratorApplication(
IFormBuilderConfigurationSerializer formBuilderConfigurationSerializer,
IEventLogService eventLogService,
IInfoProvider<ConsentInfo> consentInfoProvider,
IBizFormInfoProvider bizFormInfoProvider,
IContactGroupInfoProvider contactGroupInfoProvider,
IInfoProvider<BizFormInfo> bizFormInfoProvider,
IInfoProvider<ContactGroupInfo> contactGroupInfoProvider,
ISettingsKeyInfoProvider settingsKeyInfoProvider,
IInfoProvider<WebsiteChannelInfo> websiteChannelInfoProvider)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ internal class DancingGoatSamplesModule : Module
{
private const string DATA_PROTECTION_SAMPLES_ENABLED_SETTINGS_KEY_NAME = "DataProtectionSamplesEnabled";

private IContactInfoProvider contactInfoProvider;
private IInfoProvider<ContactInfo> contactInfoProvider;
private IMemberInfoProvider memberInfoProvider;
private IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider;
private IBizFormInfoProvider bizFormInfoProvider;
private IAccountContactInfoProvider accountContactInfoProvider;
private IInfoProvider<BizFormInfo> bizFormInfoProvider;
private IInfoProvider<AccountContactInfo> accountContactInfoProvider;
private ISettingsKeyInfoProvider settingsKeyInfoProvider;
private IActivityInfoProvider activityInfoProvider;
private IInfoProvider<ActivityInfo> activityInfoProvider;
private ICountryInfoProvider countryInfoProvider;
private IStateInfoProvider stateInfoProvider;
private IAccountInfoProvider accountInfoProvider;
private IInfoProvider<AccountInfo> accountInfoProvider;


/// <summary>
Expand All @@ -57,16 +57,16 @@ protected override void OnInit()
{
base.OnInit();

contactInfoProvider = Service.Resolve<IContactInfoProvider>();
contactInfoProvider = Service.Resolve<IInfoProvider<ContactInfo>>();
memberInfoProvider = Service.Resolve<IMemberInfoProvider>();
consentAgreementInfoProvider = Service.Resolve<IInfoProvider<ConsentAgreementInfo>>();
bizFormInfoProvider = Service.Resolve<IBizFormInfoProvider>();
accountContactInfoProvider = Service.Resolve<IAccountContactInfoProvider>();
bizFormInfoProvider = Service.Resolve<IInfoProvider<BizFormInfo>>();
accountContactInfoProvider = Service.Resolve<IInfoProvider<AccountContactInfo>>();
settingsKeyInfoProvider = Service.Resolve<ISettingsKeyInfoProvider>();
activityInfoProvider = Service.Resolve<IActivityInfoProvider>();
activityInfoProvider = Service.Resolve<IInfoProvider<ActivityInfo>>();
countryInfoProvider = Service.Resolve<ICountryInfoProvider>();
stateInfoProvider = Service.Resolve<IStateInfoProvider>();
accountInfoProvider = Service.Resolve<IAccountInfoProvider>();
accountInfoProvider = Service.Resolve<IInfoProvider<AccountInfo>>();

InitializeSamples();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ namespace Samples.DancingGoat
/// </summary>
internal class SampleContactInfoIdentityCollector : IIdentityCollector
{
private readonly IContactInfoProvider contactInfoProvider;
private readonly IInfoProvider<ContactInfo> contactInfoProvider;


/// <summary>
/// Initializes a new instance of the <see cref="SampleContactInfoIdentityCollector"/> class.
/// </summary>
/// <param name="contactInfoProvider">Contact info provider.</param>
public SampleContactInfoIdentityCollector(IContactInfoProvider contactInfoProvider)
public SampleContactInfoIdentityCollector(IInfoProvider<ContactInfo> contactInfoProvider)
{
this.contactInfoProvider = contactInfoProvider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ namespace Samples.DancingGoat
/// </summary>
internal class SampleContactDataCollector : IPersonalDataCollector
{
private readonly IActivityInfoProvider activityInfoProvider;
private readonly IInfoProvider<ActivityInfo> activityInfoProvider;
private readonly ICountryInfoProvider countryInfoProvider;
private readonly IStateInfoProvider stateInfoProvider;
private readonly IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider;
private readonly IAccountContactInfoProvider accountContactInfoProvider;
private readonly IAccountInfoProvider accountInfoProvider;
private readonly IBizFormInfoProvider bizFormInfoProvider;
private readonly IInfoProvider<AccountContactInfo> accountContactInfoProvider;
private readonly IInfoProvider<AccountInfo> accountInfoProvider;
private readonly IInfoProvider<BizFormInfo> bizFormInfoProvider;


/// <summary>
Expand All @@ -34,13 +34,13 @@ internal class SampleContactDataCollector : IPersonalDataCollector
/// <param name="accountInfoProvider">Account info provider.</param>
/// <param name="bizFormInfoProvider">BizForm info provider.</param>
public SampleContactDataCollector(
IActivityInfoProvider activityInfoProvider,
IInfoProvider<ActivityInfo> activityInfoProvider,
ICountryInfoProvider countryInfoProvider,
IStateInfoProvider stateInfoProvider,
IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider,
IAccountContactInfoProvider accountContactInfoProvider,
IAccountInfoProvider accountInfoProvider,
IBizFormInfoProvider bizFormInfoProvider)
IInfoProvider<AccountContactInfo> accountContactInfoProvider,
IInfoProvider<AccountInfo> accountInfoProvider,
IInfoProvider<BizFormInfo> bizFormInfoProvider)
{
this.activityInfoProvider = activityInfoProvider;
this.countryInfoProvider = countryInfoProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ namespace Samples.DancingGoat
internal class SampleContactDataCollectorCore
{
private readonly IPersonalDataWriter writer;
private readonly IActivityInfoProvider activityInfoProvider;
private readonly IInfoProvider<ActivityInfo> activityInfoProvider;
private readonly ICountryInfoProvider countryInfoProvider;
private readonly IStateInfoProvider stateInfoProvider;
private readonly IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider;
private readonly IAccountContactInfoProvider accountContactInfoProvider;
private readonly IAccountInfoProvider accountInfoProvider;
private readonly IBizFormInfoProvider bizFormInfoProvider;
private readonly IInfoProvider<AccountContactInfo> accountContactInfoProvider;
private readonly IInfoProvider<AccountInfo> accountInfoProvider;
private readonly IInfoProvider<BizFormInfo> bizFormInfoProvider;

// Lists store Tuples of database column names and their corresponding display names.
private readonly List<CollectedColumn> contactInfoColumns = new List<CollectedColumn> {
Expand Down Expand Up @@ -325,13 +325,13 @@ private object TransformConsentAction(string columnName, object columnValue)
/// <param name="bizFormInfoProvider">BizForm info provider.</param>
public SampleContactDataCollectorCore(
IPersonalDataWriter writer,
IActivityInfoProvider activityInfoProvider,
IInfoProvider<ActivityInfo> activityInfoProvider,
ICountryInfoProvider countryInfoProvider,
IStateInfoProvider stateInfoProvider,
IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider,
IAccountContactInfoProvider accountContactInfoProvider,
IAccountInfoProvider accountInfoProvider,
IBizFormInfoProvider bizFormInfoProvider)
IInfoProvider<AccountContactInfo> accountContactInfoProvider,
IInfoProvider<AccountInfo> accountInfoProvider,
IInfoProvider<BizFormInfo> bizFormInfoProvider)
{
this.writer = writer;
this.activityInfoProvider = activityInfoProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ internal class SampleContactPersonalDataEraser : IPersonalDataEraser
};

private readonly IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider;
private readonly IBizFormInfoProvider bizFormInfoProvider;
private readonly IAccountContactInfoProvider accountContactInfoProvider;
private readonly IContactInfoProvider contactInfoProvider;
private readonly IInfoProvider<BizFormInfo> bizFormInfoProvider;
private readonly IInfoProvider<AccountContactInfo> accountContactInfoProvider;
private readonly IInfoProvider<ContactInfo> contactInfoProvider;


/// <summary>
Expand All @@ -50,9 +50,9 @@ internal class SampleContactPersonalDataEraser : IPersonalDataEraser
/// <param name="contactInfoProvider">Contact info provider.</param>
public SampleContactPersonalDataEraser(
IInfoProvider<ConsentAgreementInfo> consentAgreementInfoProvider,
IBizFormInfoProvider bizFormInfoProvider,
IAccountContactInfoProvider accountContactInfoProvider,
IContactInfoProvider contactInfoProvider)
IInfoProvider<BizFormInfo> bizFormInfoProvider,
IInfoProvider<AccountContactInfo> accountContactInfoProvider,
IInfoProvider<ContactInfo> contactInfoProvider)
{
this.consentAgreementInfoProvider = consentAgreementInfoProvider;
this.bizFormInfoProvider = bizFormInfoProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CMS.ContactManagement;
using CMS.DataEngine;
using CMS.MacroEngine;
using CMS.Membership;

Expand All @@ -9,14 +10,14 @@ public class FormContactGroupGenerator
private const string CONTACT_GROUP_DISPLAY_NAME = "Coffee samples applicants";
private const string CONTACT_GROUP_NAME = "CoffeeSamplesApplicants";

private readonly IContactGroupInfoProvider contactGroupInfoProvider;
private readonly IInfoProvider<ContactGroupInfo> contactGroupInfoProvider;


/// <summary>
/// Initializes a new instance of the <see cref="FormContactGroupGenerator"/> class.
/// </summary>
/// <param name="contactGroupInfoProvider">Contact group info provider.</param>
public FormContactGroupGenerator(IContactGroupInfoProvider contactGroupInfoProvider)
public FormContactGroupGenerator(IInfoProvider<ContactGroupInfo> contactGroupInfoProvider)
{
this.contactGroupInfoProvider = contactGroupInfoProvider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class FormConsentGenerator

private readonly IFormBuilderConfigurationSerializer formBuilderConfigurationSerializer;
private readonly IInfoProvider<ConsentInfo> consentInfoProvider;
private readonly IBizFormInfoProvider bizFormInfoProvider;
private readonly IInfoProvider<BizFormInfo> bizFormInfoProvider;


/// <summary>
Expand All @@ -41,7 +41,7 @@ public class FormConsentGenerator
public FormConsentGenerator(
IFormBuilderConfigurationSerializer formBuilderConfigurationSerializer,
IInfoProvider<ConsentInfo> consentInfoProvider,
IBizFormInfoProvider bizFormInfoProvider)
IInfoProvider<BizFormInfo> bizFormInfoProvider)
{
this.formBuilderConfigurationSerializer = formBuilderConfigurationSerializer;
this.consentInfoProvider = consentInfoProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected override async Task<ICommandResponse> ProcessFormData(
CodeSnippetConfigurationModel model,
ICollection<IFormItem> formItems)
{
var info = channelCodeSnippetInfoProvider.Get(ObjectID);
var info = await channelCodeSnippetInfoProvider.GetAsync(ObjectID);

model.MapToChannelCodeSnippetInfo(info);

Expand Down

0 comments on commit 16f4b19

Please sign in to comment.