Generic Collections
Generic Collections
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GenericCollection_Disctionary
{
class Program
{
static void Main(string[] args)
{
int departmentID; decimal salary;
Employee emp1 = new Employee()
{
EmployeeID = 1001,
EmployeeName = "Ram",
Salary = 15000,
DepartmentID = 1
};
Console.WriteLine("--------------------------------------------------");
if (!dictionaryEmployees.ContainsKey(departmentID))
dictionaryEmployees.Add(departmentID, salary);
}
Console.WriteLine("Department wise sum of salary:");
Console.WriteLine("----------------------");