├── Metigator.OOP012.WithInheritence
├── InternSoftwareEngineer.cs
├── EmployeeV2.cs
├── Metigator.OOP012.WithInheritence.csproj
├── HRConstants.cs
├── Handyman.cs
├── Manager.cs
├── Employee.cs
├── SalesAgent.cs
├── SoftwareEngineer.cs
└── Program.cs
├── Metigator.OOP012.WithoutInInheritence
├── Metigator.OOP012.WithoutInInheritence.csproj
├── HRConstants.cs
├── Program.cs
├── Handyman.cs
├── Manager.cs
├── SalesAgent.cs
└── SoftwareEngineer.cs
├── LICENSE
├── Metigator.OOP012.sln
├── README.md
└── .gitignore
/Metigator.OOP012.WithInheritence/InternSoftwareEngineer.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithInheritence
2 | {
3 | // you can not inherit from sealed class
4 | //public class InternSoftwareEngineer: SoftwareEngineer
5 | //{
6 | //}
7 | }
8 |
--------------------------------------------------------------------------------
/Metigator.OOP012.WithInheritence/EmployeeV2.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Metigator.OOP012.WithInheritence
8 | {
9 | internal class EmployeeV2
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Metigator.OOP012.WithInheritence/Metigator.OOP012.WithInheritence.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net7.0
6 | enable
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Metigator.OOP012.WithoutInInheritence/Metigator.OOP012.WithoutInInheritence.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net7.0
6 | enable
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Metigator.OOP012.WithInheritence/HRConstants.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithInheritence
2 | {
3 | public static class HRConstants
4 | {
5 | public static decimal OvertimeRate = 1.5m;
6 | public static decimal TaxRate = 0.1m; // 10%
7 | public static decimal CommissionRate = 0.0005m; // 0.05%
8 | public static decimal SoftwareEngineerBonusAmount = 40.0m;
9 | public static int SoftwareEngineerStoryPointThreshold = 8;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Metigator.OOP012.WithoutInInheritence/HRConstants.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithoutInInheritence
2 | {
3 | public static class HRConstants
4 | {
5 | public static decimal OvertimeRate = 1.5m;
6 | public static decimal TaxRate = 0.1m; // 10%
7 | public static decimal CommissionRate = 0.0005m; // 0.05%
8 | public static decimal SoftwareEngineerBonusAmount = 40.0m;
9 | public static int SoftwareEngineerStoryPointThreshold = 8;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Metigator
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Metigator.OOP012.WithInheritence/Handyman.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithInheritence
2 | {
3 | public sealed class Handyman : Employee
4 | {
5 | public decimal Hardship { get; set; }
6 |
7 |
8 | protected override decimal CalculateGrossPay()
9 | {
10 | return base.CalculateGrossPay() + Hardship;
11 | }
12 |
13 | public override string ShowSalarySlip()
14 | {
15 | decimal basicSalary = CalculateBasicSalary();
16 | decimal grossSalary = CalculateGrossPay();
17 | decimal taxAmount = CalculateTaxAmount();
18 | decimal netSalary = CalculateNetSalary();
19 | decimal overtime = CalculateOvertimeAmount();
20 |
21 | return $"Employee: #{Id} ({FullName}).\n" +
22 | $"Hours Logged: {LoggedHours} hrs.\n" +
23 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
24 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
25 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
26 | $"Hardship: {Hardship.ToString("C")}\n" +
27 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
28 | $"Tax Amount ({HRConstants.TaxRate.ToString("%0")}): {taxAmount.ToString("C")}\n" +
29 | $"-------------------------------------\n" +
30 | $"Net Salary: {netSalary.ToString("C")}";
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/Metigator.OOP012.WithInheritence/Manager.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithInheritence
2 | {
3 | public sealed class Manager : Employee
4 | {
5 | public decimal Allowance { get; set; }
6 |
7 | protected override decimal CalculateGrossPay()
8 | {
9 | return base.CalculateGrossPay() + Allowance;
10 | }
11 |
12 | public override string ShowSalarySlip()
13 | {
14 | decimal basicSalary = CalculateBasicSalary();
15 | decimal grossSalary = CalculateGrossPay();
16 | decimal taxAmount = CalculateTaxAmount();
17 | decimal netSalary = CalculateNetSalary();
18 | decimal overtime = CalculateOvertimeAmount();
19 |
20 | return $"Employee: #{Id} ({FullName}).\n" +
21 | $"Hours Logged: {LoggedHours} hrs.\n" +
22 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
23 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
24 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
25 | $"Allowance: {Allowance.ToString("C")}\n" +
26 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
27 | $"Tax Amount ({HRConstants.TaxRate.ToString("%0")}): {taxAmount.ToString("C")}\n" +
28 | $"-------------------------------------\n" +
29 | $"Net Salary: {netSalary.ToString("C")}";
30 | }
31 |
32 |
33 | }
34 | }
--------------------------------------------------------------------------------
/Metigator.OOP012.WithInheritence/Employee.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithInheritence
2 | {
3 | public abstract class Employee
4 | {
5 | public int Id { get; set; }
6 | public string FName { get; set; }
7 | public string LName { get; set; }
8 | public decimal HourlyRate { get; set; }
9 | public int ExpectedHours { get; set; }
10 | public int LoggedHours { get; set; }
11 |
12 | public string FullName => $"{FName} {LName}";
13 |
14 |
15 | protected decimal CalculateBasicSalary()
16 | {
17 | int hoursDeviation = LoggedHours - ExpectedHours; // +/-
18 | int regularHours = LoggedHours - Math.Max(hoursDeviation, 0);
19 | return regularHours * HourlyRate;
20 | }
21 | protected decimal CalculateOvertimeAmount()
22 | {
23 | int hoursDeviation = LoggedHours - ExpectedHours;
24 | return Math.Max(hoursDeviation, 0) * HRConstants.OvertimeRate * HourlyRate;
25 | }
26 |
27 | protected virtual decimal CalculateGrossPay()
28 | {
29 | return CalculateBasicSalary() + CalculateOvertimeAmount();
30 | }
31 |
32 | protected decimal CalculateTaxAmount()
33 | {
34 | return CalculateGrossPay() * HRConstants.TaxRate;
35 | }
36 |
37 | protected decimal CalculateNetSalary()
38 | {
39 | return CalculateGrossPay() - CalculateTaxAmount();
40 | }
41 |
42 | public abstract string ShowSalarySlip();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Metigator.OOP012.WithInheritence/SalesAgent.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithInheritence
2 | {
3 | public sealed class SalesAgent : Employee
4 | {
5 | public decimal TotalSales { get; set; }
6 |
7 | private decimal CalculateCommissionAmount()
8 | {
9 | return TotalSales * HRConstants.CommissionRate;
10 | }
11 | protected override decimal CalculateGrossPay()
12 | {
13 | return base.CalculateGrossPay() + CalculateCommissionAmount();
14 | }
15 |
16 |
17 | public override string ShowSalarySlip()
18 | {
19 | decimal basicSalary = CalculateBasicSalary();
20 | decimal grossSalary = CalculateGrossPay();
21 | decimal taxAmount = CalculateTaxAmount();
22 | decimal netSalary = CalculateNetSalary();
23 | decimal overtime = CalculateOvertimeAmount();
24 | decimal commission = CalculateCommissionAmount();
25 |
26 | return $"Employee: #{Id} ({FullName}).\n" +
27 | $"Hours Logged: {LoggedHours} hrs.\n" +
28 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
29 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
30 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
31 | $"Total Sales: {TotalSales.ToString("C")}\n" +
32 | $"Commission({HRConstants.CommissionRate.ToString("%0")}): {commission.ToString("C")}\n" +
33 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
34 | $"Tax Amount ({HRConstants.TaxRate.ToString("%0")}): {taxAmount.ToString("C")}\n" +
35 | $"-------------------------------------\n" +
36 | $"Net Salary: {netSalary.ToString("C")}";
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/Metigator.OOP012.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.0.31903.59
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Metigator.OOP012.WithoutInInheritence", "Metigator.OOP012.WithoutInInheritence\Metigator.OOP012.WithoutInInheritence.csproj", "{C53AFBA1-C874-4546-94D0-3110C6D7CB3A}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Metigator.OOP012.WithInheritence", "Metigator.OOP012.WithInheritence\Metigator.OOP012.WithInheritence.csproj", "{EDF0E3A5-BF67-40B8-AD99-CFCB5D590F5F}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {C53AFBA1-C874-4546-94D0-3110C6D7CB3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {C53AFBA1-C874-4546-94D0-3110C6D7CB3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {C53AFBA1-C874-4546-94D0-3110C6D7CB3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {C53AFBA1-C874-4546-94D0-3110C6D7CB3A}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {EDF0E3A5-BF67-40B8-AD99-CFCB5D590F5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {EDF0E3A5-BF67-40B8-AD99-CFCB5D590F5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {EDF0E3A5-BF67-40B8-AD99-CFCB5D590F5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {EDF0E3A5-BF67-40B8-AD99-CFCB5D590F5F}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {0BCE9793-D245-4231-B426-E165B26C69DA}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Metigator.OOP012.WithInheritence/SoftwareEngineer.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithInheritence
2 | {
3 | public sealed class SoftwareEngineer : Employee
4 | {
5 | public decimal TrainingAllowance { get; set; }
6 | public int StoryPointCompleted { get; set; }
7 |
8 | protected override decimal CalculateGrossPay()
9 | {
10 | return base.CalculateGrossPay() + CalculateBonusAmount() + TrainingAllowance;
11 | }
12 |
13 | private decimal CalculateBonusAmount()
14 | {
15 | return StoryPointCompleted >= HRConstants.SoftwareEngineerStoryPointThreshold
16 | ? HRConstants.SoftwareEngineerBonusAmount
17 | : 0;
18 | }
19 |
20 |
21 | public override string ShowSalarySlip()
22 | {
23 | decimal basicSalary = CalculateBasicSalary();
24 | decimal grossSalary = CalculateGrossPay();
25 | decimal taxAmount = CalculateTaxAmount();
26 | decimal netSalary = CalculateNetSalary();
27 | decimal overtime = CalculateOvertimeAmount();
28 | decimal bonus = CalculateBonusAmount();
29 |
30 | return $"Employee: #{Id} ({FullName}).\n" +
31 | $"Hours Logged: {LoggedHours} hrs.\n" +
32 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
33 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
34 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
35 | $"Training Allowance: {TrainingAllowance.ToString("C")}\n" +
36 | $"Bonus(>={HRConstants.SoftwareEngineerStoryPointThreshold}): {bonus.ToString("C")}\n" +
37 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
38 | $"Tax Amount ({HRConstants.TaxRate.ToString("%0")}): {taxAmount.ToString("C")}\n" +
39 | $"-------------------------------------\n" +
40 | $"Net Salary: {netSalary.ToString("C")}";
41 | }
42 |
43 |
44 | }
45 | }
--------------------------------------------------------------------------------
/Metigator.OOP012.WithoutInInheritence/Program.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithoutInInheritence
2 | {
3 | class Program
4 | {
5 | public static void Main(string[] args)
6 | {
7 | var manager = new Manager
8 | {
9 | Id = 1001,
10 | FName = "Ahmad",
11 | LName = "Salem",
12 | HourlyRate = 10.0m,
13 | ExpectedHours = 40,
14 | LoggedHours = 40,
15 | Allowance = 100,
16 | };
17 |
18 | Console.WriteLine("------ Manager ---------");
19 | Console.WriteLine(manager.ShowSalarySlip());
20 | Console.WriteLine();
21 |
22 | var salesAgent = new SalesAgent
23 | {
24 | Id = 1002,
25 | FName = "Reem",
26 | LName = "Abdallah",
27 | HourlyRate = 10.0m,
28 | ExpectedHours = 40,
29 | LoggedHours = 45,
30 | TotalSales = 10000
31 | };
32 | Console.WriteLine("------ Sales Agent ---------");
33 | Console.WriteLine(salesAgent.ShowSalarySlip());
34 | Console.WriteLine();
35 |
36 | var handyman = new Handyman
37 | {
38 | Id = 1003,
39 | FName = "Salah",
40 | LName = "Adel",
41 | HourlyRate = 5.0m,
42 | ExpectedHours = 40,
43 | LoggedHours = 65,
44 | Hardship = 75,
45 | };
46 | Console.WriteLine("------ Handyman ---------");
47 | Console.WriteLine(handyman.ShowSalarySlip());
48 | Console.WriteLine();
49 |
50 | var softwareEngineer = new SoftwareEngineer
51 | {
52 | Id = 1004,
53 | FName = "Madiha",
54 | LName = "Rawi",
55 | HourlyRate = 10.0m,
56 | ExpectedHours = 40,
57 | LoggedHours = 40,
58 | TrainingAllowance = 50,
59 | StoryPointCompleted = 8
60 | };
61 | Console.WriteLine("------ Software Engineer ---------");
62 | Console.WriteLine(softwareEngineer.ShowSalarySlip());
63 | Console.WriteLine();
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/Metigator.OOP012.WithoutInInheritence/Handyman.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithoutInInheritence
2 | {
3 | public class Handyman
4 | {
5 | public int Id { get; set; }
6 | public string FName { get; set; }
7 | public string LName { get; set; }
8 | public decimal HourlyRate { get; set; }
9 | public int ExpectedHours { get; set; }
10 | public int LoggedHours { get; set; }
11 | public decimal Hardship { get; set; }
12 |
13 | public string FullName => $"{FName} {LName}";
14 |
15 | private decimal CalculateBasicSalary()
16 | {
17 | int hoursDeviation = LoggedHours - ExpectedHours; // +/-
18 | int regularHours = LoggedHours - Math.Max(hoursDeviation, 0);
19 | return regularHours * HourlyRate;
20 | }
21 |
22 | private decimal CalculateOvertimeAmount()
23 | {
24 | int hoursDeviation = LoggedHours - ExpectedHours;
25 | return Math.Max(hoursDeviation, 0) * HRConstants.OvertimeRate * HourlyRate;
26 | }
27 |
28 | private decimal CalculateGrossPay()
29 | {
30 | return CalculateBasicSalary() + CalculateOvertimeAmount() + Hardship;
31 | }
32 |
33 | private decimal CalculateTaxAmount()
34 | {
35 | return CalculateGrossPay() * HRConstants.TaxRate;
36 | }
37 |
38 | private decimal CalculateNetSalary()
39 | {
40 | return CalculateGrossPay() - CalculateTaxAmount();
41 | }
42 |
43 | public string ShowSalarySlip()
44 | {
45 | decimal basicSalary = CalculateBasicSalary();
46 | decimal grossSalary = CalculateGrossPay();
47 | decimal taxAmount = CalculateTaxAmount();
48 | decimal netSalary = CalculateNetSalary();
49 | decimal overtime = CalculateOvertimeAmount();
50 |
51 | return $"Employee: #{Id} ({FullName}).\n" +
52 | $"Hours Logged: {LoggedHours} hrs.\n" +
53 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
54 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
55 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
56 | $"Hardship: {Hardship.ToString("C")}\n" +
57 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
58 | $"Tax Amount ({(HRConstants.TaxRate).ToString("%0")}): {taxAmount.ToString("C")}\n" +
59 | $"-------------------------------------\n" +
60 | $"Net Salary: {netSalary.ToString("C")}";
61 | }
62 | }
63 | }
--------------------------------------------------------------------------------
/Metigator.OOP012.WithoutInInheritence/Manager.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithoutInInheritence
2 | {
3 | public class Manager
4 | {
5 | public int Id { get; set; }
6 | public string FName { get; set; }
7 | public string LName { get; set; }
8 | public decimal HourlyRate { get; set; }
9 | public int ExpectedHours { get; set; }
10 | public int LoggedHours { get; set; }
11 | public decimal Allowance { get; set; }
12 |
13 | public string FullName => $"{FName} {LName}";
14 |
15 | private decimal CalculateBasicSalary()
16 | {
17 | int hoursDeviation = LoggedHours - ExpectedHours; // +/-
18 | int regularHours = LoggedHours - Math.Max(hoursDeviation, 0);
19 | return regularHours * HourlyRate;
20 | }
21 |
22 | private decimal CalculateOvertimeAmount()
23 | {
24 | int hoursDeviation = LoggedHours - ExpectedHours;
25 | return Math.Max(hoursDeviation, 0) * HRConstants.OvertimeRate * HourlyRate;
26 | }
27 |
28 | private decimal CalculateGrossPay()
29 | {
30 | return CalculateBasicSalary() + CalculateOvertimeAmount() + Allowance;
31 | }
32 |
33 | private decimal CalculateTaxAmount()
34 | {
35 | return CalculateGrossPay() * HRConstants.TaxRate;
36 | }
37 |
38 | private decimal CalculateNetSalary()
39 | {
40 | return CalculateGrossPay() - CalculateTaxAmount();
41 | }
42 |
43 | public string ShowSalarySlip()
44 | {
45 | decimal basicSalary = CalculateBasicSalary();
46 | decimal grossSalary = CalculateGrossPay();
47 | decimal taxAmount = CalculateTaxAmount();
48 | decimal netSalary = CalculateNetSalary();
49 | decimal overtime = CalculateOvertimeAmount();
50 |
51 | return $"Employee: #{Id} ({FullName}).\n" +
52 | $"Hours Logged: {LoggedHours} hrs.\n" +
53 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
54 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
55 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
56 | $"Allowance: {Allowance.ToString("C")}\n" +
57 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
58 | $"Tax Amount ({(HRConstants.TaxRate).ToString("%0")}): {taxAmount.ToString("C")}\n" +
59 | $"-------------------------------------\n" +
60 | $"Net Salary: {netSalary.ToString("C")}";
61 | }
62 |
63 |
64 | }
65 | }
--------------------------------------------------------------------------------
/Metigator.OOP012.WithoutInInheritence/SalesAgent.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithoutInInheritence
2 | {
3 | public class SalesAgent
4 | {
5 | public int Id { get; set; }
6 | public string FName { get; set; }
7 | public string LName { get; set; }
8 | public decimal HourlyRate { get; set; }
9 | public int ExpectedHours { get; set; }
10 | public int LoggedHours { get; set; }
11 | public decimal TotalSales { get; set; }
12 |
13 | public string FullName => $"{FName} {LName}";
14 |
15 | private decimal CalculateBasicSalary()
16 | {
17 | int hoursDeviation = LoggedHours - ExpectedHours; // +/-
18 | int regularHours = LoggedHours - Math.Max(hoursDeviation, 0);
19 | return regularHours * HourlyRate;
20 | }
21 |
22 | private decimal CalculateOvertimeAmount()
23 | {
24 | int hoursDeviation = LoggedHours - ExpectedHours;
25 | return Math.Max(hoursDeviation, 0) * HRConstants.OvertimeRate * HourlyRate;
26 | }
27 |
28 | private decimal CalculateCommissionAmount()
29 | {
30 | return TotalSales * HRConstants.CommissionRate;
31 | }
32 |
33 | private decimal CalculateGrossPay()
34 | {
35 | return CalculateBasicSalary() + CalculateOvertimeAmount() + CalculateCommissionAmount();
36 | }
37 |
38 | private decimal CalculateTaxAmount()
39 | {
40 | return CalculateGrossPay() * HRConstants.TaxRate;
41 | }
42 |
43 | private decimal CalculateNetSalary()
44 | {
45 | return CalculateGrossPay() - CalculateTaxAmount();
46 | }
47 | public string ShowSalarySlip()
48 | {
49 | decimal basicSalary = CalculateBasicSalary();
50 | decimal grossSalary = CalculateGrossPay();
51 | decimal taxAmount = CalculateTaxAmount();
52 | decimal netSalary = CalculateNetSalary();
53 | decimal overtime = CalculateOvertimeAmount();
54 | decimal commission = CalculateCommissionAmount();
55 |
56 | return $"Employee: #{Id} ({FullName}).\n" +
57 | $"Hours Logged: {LoggedHours} hrs.\n" +
58 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
59 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
60 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
61 | $"Total Sales: {TotalSales.ToString("C")}\n" +
62 | $"Commission({(HRConstants.CommissionRate).ToString("%0")}): {commission.ToString("C")}\n" +
63 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
64 | $"Tax Amount ({(HRConstants.TaxRate).ToString("%0")}): {taxAmount.ToString("C")}\n" +
65 | $"-------------------------------------\n" +
66 | $"Net Salary: {netSalary.ToString("C")}";
67 | }
68 | }
69 | }
--------------------------------------------------------------------------------
/Metigator.OOP012.WithoutInInheritence/SoftwareEngineer.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithoutInInheritence
2 | {
3 | public class SoftwareEngineer
4 | {
5 | public int Id { get; set; }
6 | public string FName { get; set; }
7 | public string LName { get; set; }
8 | public decimal HourlyRate { get; set; }
9 | public int ExpectedHours { get; set; }
10 | public int LoggedHours { get; set; }
11 | public decimal TrainingAllowance { get; set; }
12 | public int StoryPointCompleted { get; set; }
13 |
14 | public string FullName => $"{FName} {LName}";
15 |
16 | private decimal CalculateBasicSalary()
17 | {
18 | int hoursDeviation = LoggedHours - ExpectedHours; // +/-
19 | int regularHours = LoggedHours - Math.Max(hoursDeviation, 0);
20 | return regularHours * HourlyRate;
21 | }
22 |
23 | private decimal CalculateOvertimeAmount()
24 | {
25 | int hoursDeviation = LoggedHours - ExpectedHours;
26 | return Math.Max(hoursDeviation, 0) * HRConstants.OvertimeRate * HourlyRate;
27 | }
28 |
29 | private decimal CalculateBonusAmount()
30 | {
31 | return StoryPointCompleted >= HRConstants.SoftwareEngineerStoryPointThreshold
32 | ? HRConstants.SoftwareEngineerBonusAmount
33 | : 0;
34 | }
35 |
36 | private decimal CalculateGrossPay()
37 | {
38 | return CalculateBasicSalary() + CalculateOvertimeAmount() + CalculateBonusAmount() + TrainingAllowance;
39 | }
40 |
41 | private decimal CalculateTaxAmount()
42 | {
43 | return CalculateGrossPay() * HRConstants.TaxRate;
44 | }
45 |
46 | private decimal CalculateNetSalary()
47 | {
48 | return CalculateGrossPay() - CalculateTaxAmount();
49 | }
50 |
51 | public string ShowSalarySlip()
52 | {
53 | decimal basicSalary = CalculateBasicSalary();
54 | decimal grossSalary = CalculateGrossPay();
55 | decimal taxAmount = CalculateTaxAmount();
56 | decimal netSalary = CalculateNetSalary();
57 | decimal overtime = CalculateOvertimeAmount();
58 | decimal bonus = CalculateBonusAmount();
59 |
60 | return $"Employee: #{Id} ({FullName}).\n" +
61 | $"Hours Logged: {LoggedHours} hrs.\n" +
62 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
63 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
64 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
65 | $"Training Allowance: {TrainingAllowance.ToString("C")}\n" +
66 | $"Bonus(>={HRConstants.SoftwareEngineerStoryPointThreshold}): {bonus.ToString("C")}\n" +
67 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
68 | $"Tax Amount ({(HRConstants.TaxRate).ToString("%0")}): {taxAmount.ToString("C")}\n" +
69 | $"-------------------------------------\n" +
70 | $"Net Salary: {netSalary.ToString("C")}";
71 | }
72 |
73 |
74 | }
75 | }
--------------------------------------------------------------------------------
/Metigator.OOP012.WithInheritence/Program.cs:
--------------------------------------------------------------------------------
1 | namespace Metigator.OOP012.WithInheritence
2 | {
3 | class Program
4 | {
5 | public static void Main(string[] args)
6 | {
7 | //Employee manager = new Manager
8 | //{
9 | // Id = 1001,
10 | // FName = "Ahmad",
11 | // LName = "Salem",
12 | // HourlyRate = 10.0m,
13 | // ExpectedHours = 40,
14 | // LoggedHours = 40,
15 | // Allowance = 100,
16 | //};
17 | //Console.WriteLine("------ Manager ---------");
18 | //Console.WriteLine(manager.ShowSalarySlip());
19 | //Console.WriteLine();
20 |
21 | //Employee salesAgent = new SalesAgent
22 | //{
23 | // Id = 1002,
24 | // FName = "Reem",
25 | // LName = "Abdallah",
26 | // HourlyRate = 10.0m,
27 | // ExpectedHours = 40,
28 | // LoggedHours = 45,
29 | // TotalSales = 10000
30 | //};
31 | //Console.WriteLine("------ Sales Agent ---------");
32 | //Console.WriteLine(salesAgent.ShowSalarySlip());
33 | //Console.WriteLine();
34 |
35 | //Employee handyman = new Handyman
36 | //{
37 | // Id = 1003,
38 | // FName = "Salah",
39 | // LName = "Adel",
40 | // HourlyRate = 5.0m,
41 | // ExpectedHours = 40,
42 | // LoggedHours = 65,
43 | // Hardship = 75,
44 | //};
45 | //Console.WriteLine("------ Handyman ---------");
46 | //Console.WriteLine(handyman.ShowSalarySlip());
47 | //Console.WriteLine();
48 |
49 | //Employee softwareEngineer = new SoftwareEngineer
50 | //{
51 | // Id = 1004,
52 | // FName = "Madiha",
53 | // LName = "Rawi",
54 | // HourlyRate = 10.0m,
55 | // ExpectedHours = 40,
56 | // LoggedHours = 40,
57 | // TrainingAllowance = 50,
58 | // StoryPointCompleted = 8
59 | //};
60 | //Console.WriteLine("------ Software Engineer ---------");
61 | //Console.WriteLine(softwareEngineer.ShowSalarySlip());
62 | //Console.WriteLine();
63 |
64 |
65 | List employees = new()
66 | {
67 | new Manager
68 | {
69 | Id = 1001,
70 | FName = "Ahmad",
71 | LName = "Salem",
72 | HourlyRate = 10.0m,
73 | ExpectedHours = 40,
74 | LoggedHours = 40,
75 | Allowance = 100,
76 | },
77 | new SalesAgent
78 | {
79 | Id = 1002,
80 | FName = "Reem",
81 | LName = "Abdallah",
82 | HourlyRate = 10.0m,
83 | ExpectedHours = 40,
84 | LoggedHours = 45,
85 | TotalSales = 10000
86 | },
87 | new Handyman
88 | {
89 | Id = 1003,
90 | FName = "Salah",
91 | LName = "Adel",
92 | HourlyRate = 5.0m,
93 | ExpectedHours = 40,
94 | LoggedHours = 65,
95 | Hardship = 75,
96 | },
97 | new SoftwareEngineer
98 | {
99 | Id = 1004,
100 | FName = "Madiha",
101 | LName = "Rawi",
102 | HourlyRate = 10.0m,
103 | ExpectedHours = 40,
104 | LoggedHours = 40,
105 | TrainingAllowance = 50,
106 | StoryPointCompleted = 8
107 | }
108 | };
109 |
110 | foreach (Employee employee in employees)
111 | {
112 | Console.WriteLine($"------ {employee.GetType().Name} ---------");
113 | Console.WriteLine(employee.ShowSalarySlip());
114 | Console.WriteLine();
115 | }
116 | }
117 | }
118 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PRD Document - Salary Calculation System
2 |
3 | ## Overview
4 | >The Salary Calculation System is designed to calculate the net salary for different employee roles based on their specific attributes and rules. The system supports the following employee roles: Manager, Sales Agent, Handyman, and Software Engineer.
5 |
6 | >يهدف نظام حساب الرواتب إلى حساب الرواتب الصافية لأدوار الموظفين المختلفة استنادًا إلى سماتهم والقواعد الخاصة بهم. يدعم النظام الأدوار التالية: مدير، وكيل مبيعات، حرفي، ومهندس برمجيات.
7 |
8 | 
9 |
10 |
11 |
12 |
13 |
14 | ## Features
15 |
16 | ### Manager
17 |
18 | The `Manager` class represents a manager employee.
19 |
20 | - `Id` (Integer): The employee's ID.
21 | - `FName` (String): The employee's first name.
22 | - `LName` (String): The employee's last name.
23 | - `HourlyRate` (Decimal): The hourly rate of the manager.
24 | - `ExpectedHours` (Integer): The expected number of work hours for the manager.
25 | - `LoggedHours` (Integer): The actual number of work hours logged by the manager.
26 | - `Allowance` (Decimal): Any additional allowance added to the manager's salary.
27 |
28 | ##### Manager Class
29 | ```csharp
30 | public class Manager
31 | {
32 | public int Id { get; set; }
33 | public string FName { get; set; }
34 | public string LName { get; set; }
35 | public decimal HourlyRate { get; set; }
36 | public int ExpectedHours { get; set; }
37 | public int LoggedHours { get; set; }
38 | public decimal Allowance { get; set; }
39 |
40 | public string FullName => $"{FName} {LName}";
41 |
42 | public string ShowSalarySlip()
43 | {
44 | decimal basicSalary = 0;
45 | decimal grossSalary = 0;
46 | decimal taxAmount = 0;
47 | decimal netSalary = 0;
48 | decimal overtime = 0;
49 |
50 | return $"Employee: #{Id} ({FullName}).\n" +
51 | $"Hours Logged: {LoggedHours} hrs.\n" +
52 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
53 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
54 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
55 | $"Allowance: {Allowance.ToString("C")}\n" +
56 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
57 | $"Tax Amount ({(HRConstants.TaxRate).ToString("%0")}): {taxAmount.ToString("C")}\n" +
58 | $"-------------------------------------\n" +
59 | $"Net Salary: {netSalary.ToString("C")}";
60 | }
61 | }
62 | ```
63 |
64 | ### Sales Agent
65 |
66 | ## SalesAgent Class
67 |
68 | The `SalesAgent` class represents a sales agent employee.
69 |
70 |
71 | - `Id` (Integer): The employee's ID.
72 | - `FName` (String): The employee's first name.
73 | - `LName` (String): The employee's last name.
74 | - `HourlyRate` (Decimal): The hourly rate of the sales agent.
75 | - `ExpectedHours` (Integer): The expected number of work hours for the sales agent.
76 | - `LoggedHours` (Integer): The actual number of work hours logged by the sales agent.
77 | - `TotalSales` (Decimal): The total sales amount achieved by the sales agent.
78 |
79 | ##### SalesAgent Class
80 | ```csharp
81 | public class SalesAgent
82 | {
83 | public int Id { get; set; }
84 | public string FName { get; set; }
85 | public string LName { get; set; }
86 | public decimal HourlyRate { get; set; }
87 | public int ExpectedHours { get; set; }
88 | public int LoggedHours { get; set; }
89 | public decimal TotalSales { get; set; }
90 |
91 | public string FullName => $"{FName} {LName}";
92 |
93 | public string ShowSalarySlip()
94 | {
95 | decimal basicSalary = 0;
96 | decimal grossSalary = 0;
97 | decimal taxAmount = 0;
98 | decimal netSalary = 0;
99 | decimal overtime = 0;
100 | decimal commission = 0;
101 |
102 | return $"Employee: #{Id} ({FullName}).\n" +
103 | $"Hours Logged: {LoggedHours} hrs.\n" +
104 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
105 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
106 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
107 | $"Total Sales: {TotalSales.ToString("C")}\n" +
108 | $"Commission({(HRConstants.CommissionRate).ToString("%0")}): {commission.ToString("C")}\n"+
109 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
110 | $"Tax Amount ({(HRConstants.TaxRate).ToString("%0")}): {taxAmount.ToString("C")}\n" +
111 | $"-------------------------------------\n" +
112 | $"Net Salary: {netSalary.ToString("C")}";
113 | }
114 | }
115 | ```
116 |
117 | ### Handyman
118 |
119 | The `Handyman` class represents a handyman employee.
120 |
121 |
122 | - `Id` (Integer): The employee's ID.
123 | - `FName` (String): The employee's first name.
124 | - `LName` (String): The employee's last name.
125 | - `HourlyRate` (Decimal): The hourly rate of the handyman.
126 | - `ExpectedHours` (Integer): The expected number of work hours for the handyman.
127 | - `LoggedHours` (Integer): The actual number of work hours logged by the handyman.
128 | - `Hardship` (Decimal): An additional hardship allowance for the handyman.
129 |
130 |
131 | ```csharp
132 | public class Handyman
133 | {
134 | public int Id { get; set; }
135 | public string FName { get; set; }
136 | public string LName { get; set; }
137 | public decimal HourlyRate { get; set; }
138 | public int ExpectedHours { get; set; }
139 | public int LoggedHours { get; set; }
140 | public decimal Hardship { get; set; }
141 |
142 | public string FullName => $"{FName} {LName}";
143 |
144 | public string ShowSalarySlip()
145 | {
146 | decimal basicSalary = 0;
147 | decimal grossSalary = 0;
148 | decimal taxAmount = 0;
149 | decimal netSalary = 0;
150 | decimal overtime = 0;
151 |
152 | return $"Employee: #{Id} ({FullName}).\n" +
153 | $"Hours Logged: {LoggedHours} hrs.\n" +
154 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
155 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
156 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
157 | $"Hardship: {Hardship.ToString("C")}\n" +
158 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
159 | $"Tax Amount ({(HRConstants.TaxRate).ToString("%0")}): {taxAmount.ToString("C")}\n" +
160 | $"-------------------------------------\n" +
161 | $"Net Salary: {netSalary.ToString("C")}";
162 | }
163 | }
164 | ```
165 | ### Software Engineer
166 |
167 | The `SoftwareEngineer` class represents a software engineer employee.
168 |
169 | ### Properties
170 |
171 | - `Id` (Integer): The employee's ID.
172 | - `FName` (String): The employee's first name.
173 | - `LName` (String): The employee's last name.
174 | - `HourlyRate` (Decimal): The hourly rate of the software engineer.
175 | - `ExpectedHours` (Integer): The expected number of work hours for the software engineer.
176 | - `LoggedHours` (Integer): The actual number of work hours logged by the software engineer.
177 | - `TrainingAllowance` (Decimal): The training allowance amount for the software engineer.
178 | - `StoryPointCompleted` (Integer): The number of story points completed by the software engineer.
179 |
180 | ```csharp
181 | public class SoftwareEngineer
182 | {
183 | public int Id { get; set; }
184 | public string FName { get; set; }
185 | public string LName { get; set; }
186 | public decimal HourlyRate { get; set; }
187 | public int ExpectedHours { get; set; }
188 | public int LoggedHours { get; set; }
189 | public decimal TrainingAllowance { get; set; }
190 | public int StoryPointCompleted { get; set; }
191 |
192 | public string FullName => $"{FName} {LName}";
193 |
194 | public string ShowSalarySlip()
195 | {
196 | decimal basicSalary = 0;
197 | decimal grossSalary = 0;
198 | decimal taxAmount = 0;
199 | decimal netSalary = 0;
200 | decimal overtime = 0;
201 | decimal bonus = 0;
202 |
203 | return $"Employee: #{Id} ({FullName}).\n" +
204 | $"Hours Logged: {LoggedHours} hrs.\n" +
205 | $"Hourly rate: {HourlyRate.ToString("C")} /hr.\n" +
206 | $"Basic Salary: {basicSalary.ToString("C")}\n" +
207 | $"Overtime({HRConstants.OvertimeRate}x): {overtime.ToString("C")}\n" +
208 | $"Training Allowance: {TrainingAllowance.ToString("C")}\n" +
209 | $"Bonus(>={HRConstants.SoftwareEngineerStoryPointThreshold}): {bonus.ToString("C")}\n" +
210 | $"Gross Pay: {grossSalary.ToString("C")}\n" +
211 | $"Tax Amount ({(HRConstants.TaxRate).ToString("%0")}): {taxAmount.ToString("C")}\n" +
212 | $"-------------------------------------\n" +
213 | $"Net Salary: {netSalary.ToString("C")}";
214 | }
215 | }
216 | ```
217 |
218 | ### HRConstants
219 | >To avoid magic numbers
220 | ``` csharp
221 | public static class HRConstants
222 | {
223 | public static decimal AdminAllowanceAmount = 100m;
224 | public static decimal OvertimeRate = 1.5m;
225 | public static decimal TaxRate = 0.1m; // 10%
226 | public static decimal CommissionRate = 0.0005m; // 0.05%
227 | public static decimal SoftwareEngineerBonusAmount = 40.0m;
228 | public static int SoftwareEngineerStoryPointThreshold = 8;
229 | }
230 | ```
231 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # Tye
66 | .tye/
67 |
68 | # ASP.NET Scaffolding
69 | ScaffoldingReadMe.txt
70 |
71 | # StyleCop
72 | StyleCopReport.xml
73 |
74 | # Files built by Visual Studio
75 | *_i.c
76 | *_p.c
77 | *_h.h
78 | *.ilk
79 | *.meta
80 | *.obj
81 | *.iobj
82 | *.pch
83 | *.pdb
84 | *.ipdb
85 | *.pgc
86 | *.pgd
87 | *.rsp
88 | *.sbr
89 | *.tlb
90 | *.tli
91 | *.tlh
92 | *.tmp
93 | *.tmp_proj
94 | *_wpftmp.csproj
95 | *.log
96 | *.tlog
97 | *.vspscc
98 | *.vssscc
99 | .builds
100 | *.pidb
101 | *.svclog
102 | *.scc
103 |
104 | # Chutzpah Test files
105 | _Chutzpah*
106 |
107 | # Visual C++ cache files
108 | ipch/
109 | *.aps
110 | *.ncb
111 | *.opendb
112 | *.opensdf
113 | *.sdf
114 | *.cachefile
115 | *.VC.db
116 | *.VC.VC.opendb
117 |
118 | # Visual Studio profiler
119 | *.psess
120 | *.vsp
121 | *.vspx
122 | *.sap
123 |
124 | # Visual Studio Trace Files
125 | *.e2e
126 |
127 | # TFS 2012 Local Workspace
128 | $tf/
129 |
130 | # Guidance Automation Toolkit
131 | *.gpState
132 |
133 | # ReSharper is a .NET coding add-in
134 | _ReSharper*/
135 | *.[Rr]e[Ss]harper
136 | *.DotSettings.user
137 |
138 | # TeamCity is a build add-in
139 | _TeamCity*
140 |
141 | # DotCover is a Code Coverage Tool
142 | *.dotCover
143 |
144 | # AxoCover is a Code Coverage Tool
145 | .axoCover/*
146 | !.axoCover/settings.json
147 |
148 | # Coverlet is a free, cross platform Code Coverage Tool
149 | coverage*.json
150 | coverage*.xml
151 | coverage*.info
152 |
153 | # Visual Studio code coverage results
154 | *.coverage
155 | *.coveragexml
156 |
157 | # NCrunch
158 | _NCrunch_*
159 | .*crunch*.local.xml
160 | nCrunchTemp_*
161 |
162 | # MightyMoose
163 | *.mm.*
164 | AutoTest.Net/
165 |
166 | # Web workbench (sass)
167 | .sass-cache/
168 |
169 | # Installshield output folder
170 | [Ee]xpress/
171 |
172 | # DocProject is a documentation generator add-in
173 | DocProject/buildhelp/
174 | DocProject/Help/*.HxT
175 | DocProject/Help/*.HxC
176 | DocProject/Help/*.hhc
177 | DocProject/Help/*.hhk
178 | DocProject/Help/*.hhp
179 | DocProject/Help/Html2
180 | DocProject/Help/html
181 |
182 | # Click-Once directory
183 | publish/
184 |
185 | # Publish Web Output
186 | *.[Pp]ublish.xml
187 | *.azurePubxml
188 | # Note: Comment the next line if you want to checkin your web deploy settings,
189 | # but database connection strings (with potential passwords) will be unencrypted
190 | *.pubxml
191 | *.publishproj
192 |
193 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
194 | # checkin your Azure Web App publish settings, but sensitive information contained
195 | # in these scripts will be unencrypted
196 | PublishScripts/
197 |
198 | # NuGet Packages
199 | *.nupkg
200 | # NuGet Symbol Packages
201 | *.snupkg
202 | # The packages folder can be ignored because of Package Restore
203 | **/[Pp]ackages/*
204 | # except build/, which is used as an MSBuild target.
205 | !**/[Pp]ackages/build/
206 | # Uncomment if necessary however generally it will be regenerated when needed
207 | #!**/[Pp]ackages/repositories.config
208 | # NuGet v3's project.json files produces more ignorable files
209 | *.nuget.props
210 | *.nuget.targets
211 |
212 | # Microsoft Azure Build Output
213 | csx/
214 | *.build.csdef
215 |
216 | # Microsoft Azure Emulator
217 | ecf/
218 | rcf/
219 |
220 | # Windows Store app package directories and files
221 | AppPackages/
222 | BundleArtifacts/
223 | Package.StoreAssociation.xml
224 | _pkginfo.txt
225 | *.appx
226 | *.appxbundle
227 | *.appxupload
228 |
229 | # Visual Studio cache files
230 | # files ending in .cache can be ignored
231 | *.[Cc]ache
232 | # but keep track of directories ending in .cache
233 | !?*.[Cc]ache/
234 |
235 | # Others
236 | ClientBin/
237 | ~$*
238 | *~
239 | *.dbmdl
240 | *.dbproj.schemaview
241 | *.jfm
242 | *.pfx
243 | *.publishsettings
244 | orleans.codegen.cs
245 |
246 | # Including strong name files can present a security risk
247 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
248 | #*.snk
249 |
250 | # Since there are multiple workflows, uncomment next line to ignore bower_components
251 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
252 | #bower_components/
253 |
254 | # RIA/Silverlight projects
255 | Generated_Code/
256 |
257 | # Backup & report files from converting an old project file
258 | # to a newer Visual Studio version. Backup files are not needed,
259 | # because we have git ;-)
260 | _UpgradeReport_Files/
261 | Backup*/
262 | UpgradeLog*.XML
263 | UpgradeLog*.htm
264 | ServiceFabricBackup/
265 | *.rptproj.bak
266 |
267 | # SQL Server files
268 | *.mdf
269 | *.ldf
270 | *.ndf
271 |
272 | # Business Intelligence projects
273 | *.rdl.data
274 | *.bim.layout
275 | *.bim_*.settings
276 | *.rptproj.rsuser
277 | *- [Bb]ackup.rdl
278 | *- [Bb]ackup ([0-9]).rdl
279 | *- [Bb]ackup ([0-9][0-9]).rdl
280 |
281 | # Microsoft Fakes
282 | FakesAssemblies/
283 |
284 | # GhostDoc plugin setting file
285 | *.GhostDoc.xml
286 |
287 | # Node.js Tools for Visual Studio
288 | .ntvs_analysis.dat
289 | node_modules/
290 |
291 | # Visual Studio 6 build log
292 | *.plg
293 |
294 | # Visual Studio 6 workspace options file
295 | *.opt
296 |
297 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
298 | *.vbw
299 |
300 | # Visual Studio 6 auto-generated project file (contains which files were open etc.)
301 | *.vbp
302 |
303 | # Visual Studio 6 workspace and project file (working project files containing files to include in project)
304 | *.dsw
305 | *.dsp
306 |
307 | # Visual Studio 6 technical files
308 | *.ncb
309 | *.aps
310 |
311 | # Visual Studio LightSwitch build output
312 | **/*.HTMLClient/GeneratedArtifacts
313 | **/*.DesktopClient/GeneratedArtifacts
314 | **/*.DesktopClient/ModelManifest.xml
315 | **/*.Server/GeneratedArtifacts
316 | **/*.Server/ModelManifest.xml
317 | _Pvt_Extensions
318 |
319 | # Paket dependency manager
320 | .paket/paket.exe
321 | paket-files/
322 |
323 | # FAKE - F# Make
324 | .fake/
325 |
326 | # CodeRush personal settings
327 | .cr/personal
328 |
329 | # Python Tools for Visual Studio (PTVS)
330 | __pycache__/
331 | *.pyc
332 |
333 | # Cake - Uncomment if you are using it
334 | # tools/**
335 | # !tools/packages.config
336 |
337 | # Tabs Studio
338 | *.tss
339 |
340 | # Telerik's JustMock configuration file
341 | *.jmconfig
342 |
343 | # BizTalk build output
344 | *.btp.cs
345 | *.btm.cs
346 | *.odx.cs
347 | *.xsd.cs
348 |
349 | # OpenCover UI analysis results
350 | OpenCover/
351 |
352 | # Azure Stream Analytics local run output
353 | ASALocalRun/
354 |
355 | # MSBuild Binary and Structured Log
356 | *.binlog
357 |
358 | # NVidia Nsight GPU debugger configuration file
359 | *.nvuser
360 |
361 | # MFractors (Xamarin productivity tool) working folder
362 | .mfractor/
363 |
364 | # Local History for Visual Studio
365 | .localhistory/
366 |
367 | # Visual Studio History (VSHistory) files
368 | .vshistory/
369 |
370 | # BeatPulse healthcheck temp database
371 | healthchecksdb
372 |
373 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
374 | MigrationBackup/
375 |
376 | # Ionide (cross platform F# VS Code tools) working folder
377 | .ionide/
378 |
379 | # Fody - auto-generated XML schema
380 | FodyWeavers.xsd
381 |
382 | # VS Code files for those working on multiple tools
383 | .vscode/*
384 | !.vscode/settings.json
385 | !.vscode/tasks.json
386 | !.vscode/launch.json
387 | !.vscode/extensions.json
388 | *.code-workspace
389 |
390 | # Local History for Visual Studio Code
391 | .history/
392 |
393 | # Windows Installer files from build outputs
394 | *.cab
395 | *.msi
396 | *.msix
397 | *.msm
398 | *.msp
399 |
400 | # JetBrains Rider
401 | *.sln.iml
402 |
403 | ##
404 | ## Visual studio for Mac
405 | ##
406 |
407 |
408 | # globs
409 | Makefile.in
410 | *.userprefs
411 | *.usertasks
412 | config.make
413 | config.status
414 | aclocal.m4
415 | install-sh
416 | autom4te.cache/
417 | *.tar.gz
418 | tarballs/
419 | test-results/
420 |
421 | # Mac bundle stuff
422 | *.dmg
423 | *.app
424 |
425 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
426 | # General
427 | .DS_Store
428 | .AppleDouble
429 | .LSOverride
430 |
431 | # Icon must end with two \r
432 | Icon
433 |
434 |
435 | # Thumbnails
436 | ._*
437 |
438 | # Files that might appear in the root of a volume
439 | .DocumentRevisions-V100
440 | .fseventsd
441 | .Spotlight-V100
442 | .TemporaryItems
443 | .Trashes
444 | .VolumeIcon.icns
445 | .com.apple.timemachine.donotpresent
446 |
447 | # Directories potentially created on remote AFP share
448 | .AppleDB
449 | .AppleDesktop
450 | Network Trash Folder
451 | Temporary Items
452 | .apdisk
453 |
454 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
455 | # Windows thumbnail cache files
456 | Thumbs.db
457 | ehthumbs.db
458 | ehthumbs_vista.db
459 |
460 | # Dump file
461 | *.stackdump
462 |
463 | # Folder config file
464 | [Dd]esktop.ini
465 |
466 | # Recycle Bin used on file shares
467 | $RECYCLE.BIN/
468 |
469 | # Windows Installer files
470 | *.cab
471 | *.msi
472 | *.msix
473 | *.msm
474 | *.msp
475 |
476 | # Windows shortcuts
477 | *.lnk
478 |
--------------------------------------------------------------------------------