diff --git a/src/Shared/Entities/Appointment.cs b/src/Shared/Entities/Appointment.cs index dce6d506..f69a4d94 100644 --- a/src/Shared/Entities/Appointment.cs +++ b/src/Shared/Entities/Appointment.cs @@ -52,7 +52,5 @@ public class Appointment : BaseEntity, IAuditableEntity /// [Decompile] public bool IsNotCanceled() - { - return AppointmentStatusId != (int)AppointmentStatus.Predefined.Canceled; - } + => AppointmentStatusId != (int)AppointmentStatus.Predefined.Canceled; } diff --git a/src/Shared/Entities/Common/SoftDeleteEntity.cs b/src/Shared/Entities/Common/SoftDeleteEntity.cs index a81d5c6e..34916458 100644 --- a/src/Shared/Entities/Common/SoftDeleteEntity.cs +++ b/src/Shared/Entities/Common/SoftDeleteEntity.cs @@ -6,19 +6,13 @@ public abstract class SoftDeleteEntity : BaseEntity [Decompile] public string GetStatusName() - { - return IsDeleted ? StatusType.Inactive: StatusType.Active; - } + => IsDeleted ? StatusType.Inactive: StatusType.Active; [Decompile] public bool IsActive() - { - return !IsDeleted; - } + => !IsDeleted; [Decompile] public bool IsInactive() - { - return IsDeleted; - } + => IsDeleted; } diff --git a/src/Shared/Entities/Employee.cs b/src/Shared/Entities/Employee.cs index ebca2c75..aa4f2569 100644 --- a/src/Shared/Entities/Employee.cs +++ b/src/Shared/Entities/Employee.cs @@ -16,7 +16,7 @@ public class Employee : SoftDeleteEntity, IAuditableEntity public List EmployeeSpecialties { get; set; } public bool IsSuperAdmin() - { - return User.UserRoles.Any(userRole => userRole.RoleId == (int)Role.Predefined.Superadmin); - } + => User + .UserRoles + .Any(userRole => userRole.RoleId == (int)Role.Predefined.Superadmin); } diff --git a/src/Shared/Entities/EmployeeSchedules/IEmployeeScheduleExtensions.cs b/src/Shared/Entities/EmployeeSchedules/IEmployeeScheduleExtensions.cs index befbc89c..f7cb2c0c 100644 --- a/src/Shared/Entities/EmployeeSchedules/IEmployeeScheduleExtensions.cs +++ b/src/Shared/Entities/EmployeeSchedules/IEmployeeScheduleExtensions.cs @@ -6,35 +6,27 @@ public static class IEmployeeScheduleExtensions /// Checks if the employee's schedule is in the morning. /// public static bool IsMorningSchedule(this IEmployeeSchedule employeeSchedule) - { - return employeeSchedule.MorningStartHour is not null && + => employeeSchedule.MorningStartHour is not null && employeeSchedule.MorningEndHour is not null; - } /// /// Checks if the employee's schedule is in the afternoon. /// public static bool IsAfternoonSchedule(this IEmployeeSchedule employeeSchedule) - { - return employeeSchedule.AfternoonStartHour is not null && + => employeeSchedule.AfternoonStartHour is not null && employeeSchedule.AfternoonEndHour is not null; - } /// /// Checks if the employee does not have morning and afternoon schedule. /// public static bool HasNotSchedule(this IEmployeeSchedule employeeSchedule) - { - return !employeeSchedule.IsMorningSchedule() && + => !employeeSchedule.IsMorningSchedule() && !employeeSchedule.IsAfternoonSchedule(); - } /// /// Checks if the employee has a morning and afternoon schedule. /// public static bool HasFullSchedule(this IEmployeeSchedule employeeSchedule) - { - return employeeSchedule.IsMorningSchedule() && + => employeeSchedule.IsMorningSchedule() && employeeSchedule.IsAfternoonSchedule(); - } } diff --git a/src/Shared/Entities/OfficeSchedule.cs b/src/Shared/Entities/OfficeSchedule.cs index f02517a1..13f392d3 100644 --- a/src/Shared/Entities/OfficeSchedule.cs +++ b/src/Shared/Entities/OfficeSchedule.cs @@ -13,9 +13,7 @@ public class OfficeSchedule : SoftDeleteEntity, IAuditableEntity [Decompile] public override string ToString() - { - return StartHour.GetHourWithoutSeconds() + - " - " + - EndHour.GetHourWithoutSeconds(); - } + => StartHour.GetHourWithoutSeconds() + + " - " + + EndHour.GetHourWithoutSeconds(); } diff --git a/src/Shared/Entities/User.cs b/src/Shared/Entities/User.cs index 91ad97c5..43b43c55 100644 --- a/src/Shared/Entities/User.cs +++ b/src/Shared/Entities/User.cs @@ -15,17 +15,11 @@ public class User : BaseEntity, IAuditableEntity public List UserRoles { get; set; } public bool IsUnverified() - { - return UserRoles.First().RoleId == (int)Role.Predefined.Unverified; - } + => UserRoles.First().RoleId == (int)Role.Predefined.Unverified; public bool IsVerified() - { - return !IsUnverified(); - } + => !IsUnverified(); public bool IsBasicUser() - { - return UserRoles.Any(userRole => userRole.RoleId == (int)Role.Predefined.BasicUser); - } + => UserRoles.Any(userRole => userRole.RoleId == (int)Role.Predefined.BasicUser); }