private void mapChildren(Task task,TaskViewModel model)
{
task.ClearEmployees();
task.ClearEquipment();
if(model.EmployeeInput.IsNotEmpty())
model.EmployeeInput.Split(',').Each(x => task.AddEmployee(_repository.Find<Employee>(Int32.Parse(x))));
if(model.EquipmentInput.IsNotEmpty())
model.EquipmentInput.Split(',').Each(x => task.AddEquipment(_repository.Find<Equipment>(Int32.Parse(x))));
task.TaskType = _repository.Find<TaskType>(model.Task.TaskType.EntityId);
task.Field = _repository.Find<Field>(model.Task.Field.EntityId);
if (model.Product.IsNotEmpty())
{
var product = model.Product.Split('_');
task.InventoryProduct= _repository.Find<InventoryProduct>(Int64.Parse(product[0]));
}else
{
task.InventoryProduct = null;
}
}