public void MyAction()
        {
            var person = new Model.Person1();

            person.Id        = ID;
            person.FirstName = FirstName;
            person.LastName  = LastName;
            person.Salary    = Salary;
            AddPerson(person);

            var department = new Model.Deaprtment1();

            department.Name        = Name;
            department.Description = Description;
            department.Id          = ID;
            AddDepartment(department);
            int count = _details.Where(x => x.DepartmentId == ID).Count();
            var query = (from j in Deaprtments join i in Persons on j.Id equals i.Id where j.Id == ID && count == 0   select new { i.FirstName, i.LastName, i.Salary, j.Id }).Distinct();

            foreach (var i in query)
            {
                var j = new Model.PersonDetail
                {
                    FirstName    = i.FirstName,
                    LastName     = i.LastName,
                    Salary       = i.Salary,
                    DepartmentId = i.Id
                };



                adddetails(j);
            }
        }
 public void AddPerson(Model.Person1 person)
 {
     _pvm.Add(person);
 }