Skip to content

Commit 8a772e5

Browse files
committed
Removing some warnings and code cleanup.
1 parent afdf1f8 commit 8a772e5

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Helpers/BackendConfigurationAreaRulePlanningsServiceHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#nullable enable
12
using System;
23
using System.Collections.Generic;
34
using System.Linq;

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Helpers/WorkOrderHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#nullable enable
12
using System;
23
using System.Collections.Generic;
34
using System.Globalization;

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Models/Files/BackendConfigurationFileRequestModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
SOFTWARE.
2323
*/
2424

25+
#nullable enable
2526
namespace BackendConfiguration.Pn.Infrastructure.Models.Files;
2627

2728
using Microting.eFormApi.BasePn.Infrastructure.Models.Common;

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/PairItemWithSiteHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ await sdkDbContext.FolderTranslations.SingleOrDefaultAsync(x =>
396396

397397
private static async Task<Folder> GetTopFolder(int folderId, MicrotingDbContext dbContext)
398398
{
399-
var result = await dbContext.Folders.FirstOrDefaultAsync(y => y.Id == folderId).ConfigureAwait(false);
399+
var result = await dbContext.Folders.FirstAsync(y => y.Id == folderId).ConfigureAwait(false);
400400
if (result.ParentId != null)
401401
{
402402
result = await GetTopFolder((int)result.ParentId, dbContext).ConfigureAwait(false);

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationPropertiesService/BackendConfigurationPropertiesService.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ public async Task<OperationDataResult<List<PropertyFolderModel>>> GetLinkedFolde
611611
.Where(x => x.Id == propertyId)
612612
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
613613
.Where(x => x.FolderId.HasValue)
614-
.Select(x => x.FolderId.Value)
614+
.Select(x => x.FolderId!.Value)
615615
.ToListAsync();
616616

617617
folderIds.AddRange(await backendConfigurationPnDbContext.ProperyAreaFolders
@@ -655,7 +655,7 @@ public async Task<OperationDataResult<List<PropertyFolderModel>>> GetLinkedFolde
655655
.Where(x => propertyIds.Contains(x.Id))
656656
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
657657
.Where(x => x.FolderId.HasValue)
658-
.Select(x => x.FolderId.Value)
658+
.Select(x => x.FolderId!.Value)
659659
.ToListAsync();
660660

661661
folderIds.AddRange(await backendConfigurationPnDbContext.ProperyAreaFolders
@@ -748,6 +748,12 @@ public async Task<OperationDataResult<List<CommonDictionaryModel>>> GetLinkedSit
748748
//.Where(x => propertyIds.Contains(x.PropertyId))
749749
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed);
750750

751+
// if propertyIds is null or empty return an empty list
752+
if (propertyIds == null || !propertyIds.Any())
753+
{
754+
return new OperationDataResult<List<CommonDictionaryModel>>(true, new List<CommonDictionaryModel>());
755+
}
756+
751757
if (propertyIds.Any())
752758
{
753759
query = query.Where(x => propertyIds.Contains(x.PropertyId));

0 commit comments

Comments
 (0)