Skip to content

Commit

Permalink
Cleaning up all the build errors from namespace changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrball committed Dec 15, 2024
1 parent 81baf44 commit 2a5f2df
Show file tree
Hide file tree
Showing 57 changed files with 107 additions and 96 deletions.
4 changes: 2 additions & 2 deletions src/API/WesternStatesWater.WestDaat.Accessors/SiteAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ namespace WesternStatesWater.WestDaat.Accessors
{
internal class SiteAccessor : AccessorBase, ISiteAccessor
{
public SiteAccessor(ILogger<SiteAccessor> logger, IDatabaseContextFactory databaseContextFactory) : base(logger)
public SiteAccessor(ILogger<SiteAccessor> logger, EF.IDatabaseContextFactory databaseContextFactory) : base(logger)
{
_databaseContextFactory = databaseContextFactory;
}

private readonly IDatabaseContextFactory _databaseContextFactory;
private readonly EF.IDatabaseContextFactory _databaseContextFactory;

async Task<Site> ISiteAccessor.GetSiteByUuid(string siteUuid)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using AutoMapper.QueryableExtensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Accessors.Extensions;
using WesternStatesWater.WestDaat.Accessors.Mapping;
using WesternStatesWater.WestDaat.Common.Constants;
using WesternStatesWater.WestDaat.Common.DataContracts;
using WesternStatesWater.WestDaat.Database.EntityFramework.partials;

namespace WesternStatesWater.WestDaat.Accessors
{
internal class SystemAccessor : AccessorBase, ISystemAccessor
{
private readonly IDatabaseContextFactory _databaseContextFactory;
private readonly EF.IDatabaseContextFactory _databaseContextFactory;

public SystemAccessor(ILogger<SystemAccessor> logger, IDatabaseContextFactory databaseContextFactory)
public SystemAccessor(ILogger<SystemAccessor> logger, EF.IDatabaseContextFactory databaseContextFactory)
: base(logger)
{
_databaseContextFactory = databaseContextFactory;
Expand Down
5 changes: 2 additions & 3 deletions src/API/WesternStatesWater.WestDaat.Accessors/TestAccessor.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using WesternStatesWater.WestDaat.Accessors.EntityFramework;

namespace WesternStatesWater.WestDaat.Accessors
{
internal class TestAccessor : AccessorBase, ITestAccessor
{
public TestAccessor(ILogger<TestAccessor> logger, IDatabaseContextFactory databaseContextFactory) : base(logger)
public TestAccessor(ILogger<TestAccessor> logger, EF.IDatabaseContextFactory databaseContextFactory) : base(logger)
{
_databaseContextFactory = databaseContextFactory;
}

private readonly IDatabaseContextFactory _databaseContextFactory;
private readonly EF.IDatabaseContextFactory _databaseContextFactory;

public override string TestMe(string input)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
using System.Transactions;
using NetTopologySuite.Geometries.Utilities;
using WesternStatesWater.WestDaat.Accessors.CsvModels;
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Accessors.Extensions;
using WesternStatesWater.WestDaat.Accessors.Mapping;
using WesternStatesWater.WestDaat.Common.Configuration;
using WesternStatesWater.WestDaat.Common.DataContracts;
using WesternStatesWater.WestDaat.Database.EntityFramework.partials;
using WesternStatesWater.WestDaat.Utilities;

namespace WesternStatesWater.WestDaat.Accessors
Expand All @@ -21,13 +21,13 @@ internal class WaterAllocationAccessor : AccessorBase, IWaterAllocationAccessor
{
private readonly PerformanceConfiguration _performanceConfiguration;

public WaterAllocationAccessor(ILogger<WaterAllocationAccessor> logger, IDatabaseContextFactory databaseContextFactory, PerformanceConfiguration performanceConfiguration) : base(logger)
public WaterAllocationAccessor(ILogger<WaterAllocationAccessor> logger, EF.IDatabaseContextFactory databaseContextFactory, PerformanceConfiguration performanceConfiguration) : base(logger)
{
_databaseContextFactory = databaseContextFactory;
_performanceConfiguration = performanceConfiguration;
}

private readonly IDatabaseContextFactory _databaseContextFactory;
private readonly EF.IDatabaseContextFactory _databaseContextFactory;

public async Task<AnalyticsSummaryInformation[]> GetAnalyticsSummaryInformation(WaterRightsSearchCriteria searchCriteria)
{
Expand Down Expand Up @@ -117,9 +117,9 @@ public async Task<WaterRightsSearchResults> FindWaterRights(WaterRightsSearchCri
};
}

private static ExpressionStarter<AllocationAmountsFact> BuildWaterRightsSearchPredicate(WaterRightsSearchCriteria searchCriteria, DatabaseContext db)
private static ExpressionStarter<EF.AllocationAmountsFact> BuildWaterRightsSearchPredicate(WaterRightsSearchCriteria searchCriteria, DatabaseContext db)
{
var predicate = PredicateBuilder.New<AllocationAmountsFact>();
var predicate = PredicateBuilder.New<EF.AllocationAmountsFact>();

predicate.And(BuildBeneficialUsesPredicate(searchCriteria));

Expand All @@ -138,117 +138,117 @@ private static ExpressionStarter<AllocationAmountsFact> BuildWaterRightsSearchPr
return predicate;
}

private static ExpressionStarter<AllocationAmountsFact> BuildFromSiteUuids(WaterRightsSearchCriteria searchCriteria, DatabaseContext db)
private static ExpressionStarter<EF.AllocationAmountsFact> BuildFromSiteUuids(WaterRightsSearchCriteria searchCriteria, DatabaseContext db)
{
var predicate = PredicateBuilder.New<AllocationAmountsFact>(true);
var predicate = PredicateBuilder.New<EF.AllocationAmountsFact>(true);

if (searchCriteria?.WadeSitesUuids != null && searchCriteria.WadeSitesUuids.Any())
{
db.Database.ExecuteSqlRaw(Scripts.Scripts.CreateTempUuidTable);

db.BulkInsert(searchCriteria.WadeSitesUuids.Select(a => new TempUuid { Uuid = a }).ToList());
db.BulkInsert(searchCriteria.WadeSitesUuids.Select(a => new EF.TempUuid { Uuid = a }).ToList());

db.Database.ExecuteSqlRaw(Scripts.Scripts.CreateTempIdTable);
db.Database.ExecuteSqlRaw(Scripts.Scripts.FindSiteIdsFromUuids);

predicate = predicate.And(AllocationAmountsFact.HasSitesUuids(db));
predicate = predicate.And(EF.AllocationAmountsFact.HasSitesUuids(db));
}

return predicate;
}

private static ExpressionStarter<AllocationAmountsFact> BuildBeneficialUsesPredicate(WaterRightsSearchCriteria searchCriteria)
private static ExpressionStarter<EF.AllocationAmountsFact> BuildBeneficialUsesPredicate(WaterRightsSearchCriteria searchCriteria)
{
var predicate = PredicateBuilder.New<AllocationAmountsFact>(true);
var predicate = PredicateBuilder.New<EF.AllocationAmountsFact>(true);

if (searchCriteria?.BeneficialUses != null && searchCriteria.BeneficialUses.Any())
{
predicate = predicate.And(AllocationAmountsFact.HasBeneficialUses(searchCriteria.BeneficialUses.ToList()));
predicate = predicate.And(EF.AllocationAmountsFact.HasBeneficialUses(searchCriteria.BeneficialUses.ToList()));
}

return predicate;
}

private static ExpressionStarter<AllocationAmountsFact> BuildDatePredicate(WaterRightsSearchCriteria searchCriteria)
private static ExpressionStarter<EF.AllocationAmountsFact> BuildDatePredicate(WaterRightsSearchCriteria searchCriteria)
{
var predicate = PredicateBuilder.New<AllocationAmountsFact>(true);
var predicate = PredicateBuilder.New<EF.AllocationAmountsFact>(true);

if (searchCriteria?.MinimumPriorityDate != null || searchCriteria?.MaximumPriorityDate != null)
{
predicate.And(AllocationAmountsFact.HasPriorityDateRange(searchCriteria.MinimumPriorityDate, searchCriteria.MaximumPriorityDate));
predicate.And(EF.AllocationAmountsFact.HasPriorityDateRange(searchCriteria.MinimumPriorityDate, searchCriteria.MaximumPriorityDate));
}

return predicate;
}

private static ExpressionStarter<AllocationAmountsFact> BuildVolumeAndFlowPredicate(WaterRightsSearchCriteria searchCriteria)
private static ExpressionStarter<EF.AllocationAmountsFact> BuildVolumeAndFlowPredicate(WaterRightsSearchCriteria searchCriteria)
{
var predicate = PredicateBuilder.New<AllocationAmountsFact>(true);
var predicate = PredicateBuilder.New<EF.AllocationAmountsFact>(true);

if (searchCriteria?.ExemptOfVolumeFlowPriority != null)
{
predicate.And(AllocationAmountsFact.IsExemptOfVolumeFlowPriority(searchCriteria.ExemptOfVolumeFlowPriority.Value));
predicate.And(EF.AllocationAmountsFact.IsExemptOfVolumeFlowPriority(searchCriteria.ExemptOfVolumeFlowPriority.Value));
}

if (searchCriteria?.MinimumFlow != null || searchCriteria?.MaximumFlow != null)
{
predicate.And(AllocationAmountsFact.HasFlowRateRange(searchCriteria.MinimumFlow, searchCriteria.MaximumFlow));
predicate.And(EF.AllocationAmountsFact.HasFlowRateRange(searchCriteria.MinimumFlow, searchCriteria.MaximumFlow));
}

if (searchCriteria?.MinimumVolume != null || searchCriteria?.MaximumVolume != null)
{
predicate.And(AllocationAmountsFact.HasVolumeRange(searchCriteria.MinimumVolume, searchCriteria.MaximumVolume));
predicate.And(EF.AllocationAmountsFact.HasVolumeRange(searchCriteria.MinimumVolume, searchCriteria.MaximumVolume));
}

return predicate;
}

private static ExpressionStarter<AllocationAmountsFact> BuildOwnerSearchPredicate(WaterRightsSearchCriteria searchCriteria)
private static ExpressionStarter<EF.AllocationAmountsFact> BuildOwnerSearchPredicate(WaterRightsSearchCriteria searchCriteria)
{
var predicate = PredicateBuilder.New<AllocationAmountsFact>(true);
var predicate = PredicateBuilder.New<EF.AllocationAmountsFact>(true);

if (searchCriteria?.OwnerClassifications != null && searchCriteria.OwnerClassifications.Any())
{
predicate.And(AllocationAmountsFact.HasOwnerClassification(searchCriteria.OwnerClassifications.ToList()));
predicate.And(EF.AllocationAmountsFact.HasOwnerClassification(searchCriteria.OwnerClassifications.ToList()));
}

if (!string.IsNullOrWhiteSpace(searchCriteria?.AllocationOwner))
{
predicate.And(AllocationAmountsFact.HasAllocationOwner(searchCriteria.AllocationOwner));
predicate.And(EF.AllocationAmountsFact.HasAllocationOwner(searchCriteria.AllocationOwner));
}

return predicate;
}

private static ExpressionStarter<AllocationAmountsFact> BuildSiteDetailsPredicate(WaterRightsSearchCriteria searchCriteria)
private static ExpressionStarter<EF.AllocationAmountsFact> BuildSiteDetailsPredicate(WaterRightsSearchCriteria searchCriteria)
{
var predicate = PredicateBuilder.New<AllocationAmountsFact>(true);
var predicate = PredicateBuilder.New<EF.AllocationAmountsFact>(true);

if (searchCriteria?.WaterSourceTypes != null && searchCriteria.WaterSourceTypes.Any())
{
predicate.And(AllocationAmountsFact.HasWaterSourceTypes(searchCriteria.WaterSourceTypes.ToList()));
predicate.And(EF.AllocationAmountsFact.HasWaterSourceTypes(searchCriteria.WaterSourceTypes.ToList()));
}

if (searchCriteria?.States != null && searchCriteria.States.Any())
{
predicate.And(AllocationAmountsFact.HasOrganizationStates(searchCriteria.States.ToList()));
predicate.And(EF.AllocationAmountsFact.HasOrganizationStates(searchCriteria.States.ToList()));
}

if (!string.IsNullOrWhiteSpace(searchCriteria?.PodOrPou))
{
predicate.And(AllocationAmountsFact.IsPodOrPou(searchCriteria.PodOrPou));
predicate.And(EF.AllocationAmountsFact.IsPodOrPou(searchCriteria.PodOrPou));
}

return predicate;
}

private static ExpressionStarter<AllocationAmountsFact> BuildGeometrySearchPredicate(WaterRightsSearchCriteria searchCriteria)
private static ExpressionStarter<EF.AllocationAmountsFact> BuildGeometrySearchPredicate(WaterRightsSearchCriteria searchCriteria)
{
var predicate = PredicateBuilder.New<AllocationAmountsFact>(true);
var predicate = PredicateBuilder.New<EF.AllocationAmountsFact>(true);

if (searchCriteria?.FilterGeometry != null)
{
predicate.And(AllocationAmountsFact.IsWithinGeometry(searchCriteria.FilterGeometry));
predicate.And(EF.AllocationAmountsFact.IsWithinGeometry(searchCriteria.FilterGeometry));
}

return predicate;
Expand Down Expand Up @@ -470,7 +470,7 @@ internal IEnumerable<Variables> GetVariables(WaterRightsSearchCriteria searchCri
.AsEnumerable();
}

private (DatabaseContext DB, IQueryable<AllocationAmountsFact> AllocationAmounts) GetFilteredWaterAllocations(WaterRightsSearchCriteria searchCriteria)
private (DatabaseContext DB, IQueryable<EF.AllocationAmountsFact> AllocationAmounts) GetFilteredWaterAllocations(WaterRightsSearchCriteria searchCriteria)
{
var db = _databaseContextFactory.Create();

Expand All @@ -486,7 +486,7 @@ internal IEnumerable<Variables> GetVariables(WaterRightsSearchCriteria searchCri
return (db, waterRightDetails);
}

private (DatabaseContext DB, IQueryable<SitesDim> FilteredSites) GetFilteredSites(WaterRightsSearchCriteria searchCriteria)
private (DatabaseContext DB, IQueryable<EF.SitesDim> FilteredSites) GetFilteredSites(WaterRightsSearchCriteria searchCriteria)
{
var (db, waterRightDetails) = GetFilteredWaterAllocations(searchCriteria);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using WesternStatesWater.WestDaat.Accessors;
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Client.Functions;
using WesternStatesWater.WestDaat.Common.Configuration;
using WesternStatesWater.WestDaat.Managers;
using WesternStatesWater.WestDaat.Contracts.Client;
using WesternStatesWater.WestDaat.Database.EntityFramework;
using WesternStatesWater.WestDaat.Engines;
using WesternStatesWater.WestDaat.Utilities;

Expand Down Expand Up @@ -60,9 +60,10 @@
services.AddTransient<ITestAccessor, TestAccessor>();
services.AddTransient<IWaterAllocationAccessor, WaterAllocationAccessor>();

services.AddTransient<IDatabaseContextFactory, DatabaseContextFactory>();

services.AddTransient<IEmailNotificationSdk, EmailNotificationSdk>();
services.AddTransient<IUsgsNldiSdk, UsgsNldiSdk>();
services.AddTransient<IDatabaseContextFactory, DatabaseContextFactory>();
services.AddTransient<IBlobStorageSdk, BlobStorageSdk>();
services.AddTransient<ITemplateResourceSdk, TemplateResourceSdk>();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.ComponentModel.DataAnnotations;
using LinqKit;
using NetTopologySuite.Geometries;
using NetTopologySuite.Geometries.Utilities;
using WesternStatesWater.WestDaat.Database.EntityFramework.partials;

namespace WesternStatesWater.WestDaat.Database.EntityFramework
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using NetTopologySuite.Geometries;

namespace WesternStatesWater.WestDaat.Database.EntityFramework;

public class AllocationAmountsView
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace WesternStatesWater.WestDaat.Database.EntityFramework
using NetTopologySuite.Geometries;

namespace WesternStatesWater.WestDaat.Database.EntityFramework
{
public partial class ReportingUnitsDim
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace WesternStatesWater.WestDaat.Database.EntityFramework
using NetTopologySuite.Geometries;

namespace WesternStatesWater.WestDaat.Database.EntityFramework
{
public partial class SiteVariableAmountsFact
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using NetTopologySuite.Geometries;

namespace WesternStatesWater.WestDaat.Database.EntityFramework
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace WesternStatesWater.WestDaat.Database.EntityFramework
using NetTopologySuite.Geometries;

namespace WesternStatesWater.WestDaat.Database.EntityFramework
{
public partial class WaterSourcesDim
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System.Transactions;
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Common;
using WesternStatesWater.WestDaat.Common.Configuration;
using WesternStatesWater.WestDaat.Database.EntityFramework;

namespace WesternStatesWater.WestDaat.Tests.AccessorTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using WesternStatesWater.WestDaat.Accessors;
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Database.EntityFramework;
using WesternStatesWater.WestDaat.Tests.Helpers;
using WesternStatesWater.WestDaat.Utilities;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using WesternStatesWater.WestDaat.Accessors;
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Database.EntityFramework;
using WesternStatesWater.WestDaat.Tests.Helpers;

namespace WesternStatesWater.WestDaat.Tests.AccessorTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using WesternStatesWater.WestDaat.Accessors;
using WesternStatesWater.WestDaat.Tests.Helpers;
using EF = WesternStatesWater.WestDaat.Accessors.EntityFramework;
using EF = WesternStatesWater.WestDaat.Database.EntityFramework;
using CommonContracts = WesternStatesWater.WestDaat.Common.DataContracts;
using WesternStatesWater.WestDaat.Common.DataContracts;
using WesternStatesWater.WestDaat.Accessors.Mapping;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Database.EntityFramework;

namespace WesternStatesWater.WestDaat.Tests.Helpers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Database.EntityFramework;

namespace WesternStatesWater.WestDaat.Tests.Helpers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Database.EntityFramework;

namespace WesternStatesWater.WestDaat.Tests.Helpers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Database.EntityFramework;

namespace WesternStatesWater.WestDaat.Tests.Helpers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using WesternStatesWater.WestDaat.Accessors.EntityFramework;
using WesternStatesWater.WestDaat.Database.EntityFramework;

namespace WesternStatesWater.WestDaat.Tests.Helpers
{
Expand Down
Loading

0 comments on commit 2a5f2df

Please sign in to comment.