private Field GetFieldFromRequest(ProductRequest request) { Field result; try { result = fieldRepository.GetFieldByName(request.FieldName); } catch (RepositoryException) { result = new Field(); result.Name = request.FieldName; result.Type = request.FieldType; fieldRepository.AddEntity(result); } return(result); }