public static void Delete(Employee employee)
        {
            var context = new SoftUniEntities();

            context.Entry(employee).State = EntityState.Deleted;
            context.SaveChanges();
        }
        public static void Add(Employee employee)
        {
            var context = new SoftUniEntities();

            var entry = context.Entry(employee);
            entry.State = EntityState.Added;

            context.Employees.Add(employee);
            context.SaveChanges();
        }
        public static void ConcurrentEmployeeNameChanges(string firstConcurrent, string secondConcurrent)
        {
            var context1 = new SoftUniEntities();

            var employee1 = context1.Employees.Find(1);
            employee1.FirstName = firstConcurrent;

            var context2 = new SoftUniEntities();

            var employee2 = context2.Employees.Find(1);
            employee2.FirstName = secondConcurrent;

            context1.SaveChanges();
            context2.SaveChanges(); //It will be executed
        }
        public static void Modify(Employee employee, string newName)
        {
            var context = new SoftUniEntities();

            string[] name = Regex.Split(newName.Trim(), @"\s+");
            string firstName = Regex.Split(newName.Trim(), @"\s+")[0];
            employee.FirstName = firstName;

            if (name.Length == 2)
            {
                string lastName = Regex.Split(newName.Trim(), @"\s+")[0];
                employee.LastName = lastName;
            }

            var entry = context.Entry(employee);
            entry.State = EntityState.Modified;

            context.SaveChanges();

        }