Fixed null refrenance warning

This commit is contained in:
ashutosh.nehete 2025-04-09 08:46:29 +05:30
parent 56448cb8a2
commit ec5fba0637
9 changed files with 37 additions and 45 deletions

View File

@ -4,8 +4,8 @@
{
public DateTime AssignmentDate { get; set; }
public double PlannedTask { get; set; }
public string Description { get; set; }
public List<int> TaskTeam { get; set; } //Employee Ids
public string? Description { get; set; }
public List<int>? TaskTeam { get; set; } //Employee Ids
public int WorkItemId { get; set; }
}
}

View File

@ -1,30 +1,23 @@
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Marco.Pms.Model.Dtos.Employees
namespace Marco.Pms.Model.Dtos.Employees
{
public class CreateUserDto
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? MiddleName { get; set; }
public string? Email { get; set; }
public string Gender { get; set; }
public string? Gender { get; set; }
public string? BirthDate { get; set; }
public string JoiningDate { get; set; }
public string? JoiningDate { get; set; }
public string? PeramnentAddress { get; set; }
public string? CurrentAddress { get; set; }
public string PhoneNumber { get; set; }
public string? PhoneNumber { get; set; }
public string EmergencyPhoneNumber { get; set; }
public string EmergencyContactPerson { get; set; }
public string? EmergencyPhoneNumber { get; set; }
public string? EmergencyContactPerson { get; set; }
public string? AadharNumber { get; set; }
@ -33,25 +26,25 @@ namespace Marco.Pms.Model.Dtos.Employees
//public IFormFile? Photo { get; set; } // To store the captured photo
//public List<IFormFile>? Documents { get; set; }
public string JobRoleId { get; set; }
public string? JobRoleId { get; set; }
// public int TenantId { get; set; }
}
public class CreateQuickUserDto
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string Gender { get; set; }
public string? Gender { get; set; }
public string? CurrentAddress { get; set; }
public string PhoneNumber { get; set; }
public string? PhoneNumber { get; set; }
public string EmergencyPhoneNumber { get; set; }
public string EmergencyContactPerson { get; set; }
public string? EmergencyPhoneNumber { get; set; }
public string? EmergencyContactPerson { get; set; }
public string JobRoleId { get; set; }
public string? JobRoleId { get; set; }
}
}

View File

@ -20,7 +20,7 @@ namespace Marco.Pms.Model.ViewModels.Activities
public int WorkItemId { get; set; }
public int TenantId { get; set; }
public List<EmployeeVM> teamMembers { get; set; }
public List<EmployeeVM>? teamMembers { get; set; }
}
}

View File

@ -14,6 +14,6 @@ namespace Marco.Pms.Model.ViewModels.Activities
public int WorkItemId { get; set; }
public int TenantId { get; set; }
public List<CommentVM> Comments { get; set; }
public List<CommentVM>? Comments { get; set; }
}
}

View File

@ -12,11 +12,11 @@ namespace Marco.Pms.Model.ViewModels.Activities
public double CompletedTask { get; set; }
public DateTime? ReportedDate { get; set; }
public string? Description { get; set; }
public string AssignBy { get; set; }
public WorkItem WorkItem { get; set; }
public string Tenant { get; set; }
public string? AssignBy { get; set; }
public WorkItem? WorkItem { get; set; }
public string? Tenant { get; set; }
public List<CommentVM> Comments { get; set; }
public List<EmployeeVM> TeamMembers { get; set; }
public List<CommentVM>? Comments { get; set; }
public List<EmployeeVM>? TeamMembers { get; set; }
}
}

View File

@ -3,7 +3,7 @@
public class WorkItemVm
{
public int Id { get; set; }
public string ActivityName { get; set; }
public string? ActivityName { get; set; }
public double PlannedWork { get; set; }
public double CompletedWork { get; set; }
public DateTime TaskDate { get; set; }

View File

@ -3,20 +3,20 @@
public class EmployeeVM
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? MiddleName { get; set; }
public string? Email { get; set; }
public string Gender { get; set; }
public string? Gender { get; set; }
public DateTime? BirthDate { get; set; }
public DateTime? JoiningDate { get; set; }
public string PeramnentAddress { get; set; }
public string CurrentAddress { get; set; }
public string PhoneNumber { get; set; }
public string? PeramnentAddress { get; set; }
public string? CurrentAddress { get; set; }
public string? PhoneNumber { get; set; }
public string EmergencyPhoneNumber { get; set; }
public string EmergencyContactPerson { get; set; }
public string? EmergencyPhoneNumber { get; set; }
public string? EmergencyContactPerson { get; set; }
public string? AadharNumber { get; set; }
@ -28,7 +28,7 @@
public string? ApplicationUserId { get; set; }
public int? JobRoleId { get; set; }
public string JobRole { get; set; }
public string? JobRole { get; set; }
}
}

View File

@ -6,7 +6,7 @@ namespace MarcoBMS.Services.Service
{
void LogInfo(string? message, params object[]? args);
void LogWarning(string? message, params object[]? args);
void LogError(Exception? ex, string? message, params object[]? args);
void LogError(string? message, params object[]? args);
}
}

View File

@ -11,9 +11,8 @@ namespace MarcoBMS.Services.Service
_logger = logger;
}
public void LogError(Exception? ex, string? message, params object[]? args)
public void LogError(string? message, params object[]? args)
{
using (LogContext.PushProperty("Error", ex))
using (LogContext.PushProperty("LogLevel", "Error"))
_logger.LogError(message, args);
}